Danke für deine Antwort!
Nur deinen letzten Satz habe ich nicht ganz verstanden. Bei mir sieht es jetzt so aus:
3 Aktionen, eine fürs Messer, eine für die MG und eine für den Revolver. In einer change_weapon funktionwerden diese dann neuen Entitys zugewiesen und die alte Entity wird gelöscht. Die Aktion des Revolvers sieht vereinfacht so aus:
action players_weapon2
{
weapon1 = my; // I'm weapon1
var player1_pos; // stores the initial position of the player
var player2_pos; // stores the position of the player after a frame
my.scale_x=0.039;
my.scale_y=0.039;
my.scale_z=0.039;
while (player == null) {wait (1);} // wait until the player is created
while (1)
{
vec_set (player1_pos.x, player.x); // store the initial player position
// place the weapon 50 quants in front, 18 quants to the right and 20 quants below camera's origin
vec_set (weapon_offset.x, vector (80,waffenverschiebung, -18));
if (vec_dist (player1_pos.x, player2_pos.x) != 0) // the player has moved during the last frame?
{
weapon_height += 30 * time; // then offset weapon_height (30 = weapon waving speed)
weapon_offset.z += 0.3 * sin(weapon_height); // (0.3 = weapon waving amplitude)
}
// rotate weapon_offset according to the camera angles
vec_rotate (weapon_offset.x, vector (camera.pan, camera.tilt, 0));
vec_add (weapon_offset.x, camera.x); // add the camera position to weapon_offset
vec_set (my.x, weapon_offset.x); // set weapon's coords to weapon_offset
my.pan = camera.pan; // use the same camera angles for the weapon
my.tilt = camera.tilt;
vec_set (player2_pos.x, player.x); // store the new player coordinates after 1 frame
wait (1);
}
}
So, die Waffe wird also abhängig von einem unsichtbaren Spieler Modell bewegt...mhh da fällt mir gerade ein, könnte es seien das du Meinst, ich soll die Waffe mit c_move bewegen ,damit die Kollision erkannt wird? Dann wär nur die Frage wie das so mit dem Drehen und auf und ab Bewegen ist, aber das ist dann ein anderes Thema.:)