i button Q to swap charater in the game, but how ocme when i press q no effect?
Code:
ACTION attach_weapon {
player_weapon = my;
my.passable = on;
proc_late();
WHILE (you != null) {
vec_for_vertex(temp.x,you,1175); //hand palm base
vec_for_vertex(temp2.x,you,1240); //hand palm tip
vec_set(my.x,temp.x);
vec_diff(temp.x,temp2.x,temp.x);
vec_to_angle(temp.pan,temp.x);
vec_set(my.pan,temp.pan);
wait(1);
}
}
action player2_action{
player2 = me;
player1 = you;
ent_create("sword.mdl",my.x,attach_weapon);
my.gravity = 3;
my.z_offset = 6;
player1 = me;
player2=you;
my.shadow = on;
ent_create("sword.mdl",my.x,attach_weapon);
if(key_q==1)
{
ent_morph(me,char1);
ent_morph (you,char2);
}
wait(1);
WHILE (1) {
handle_player2_gravity();
handle_player2_movement();
handle_camera();
handle_player2_animation(1);
wait(1);
}
}
ACTION player1_action
{
my.gravity = 3;
my.z_offset = 6;
player1 = me;
player2=you;
my.shadow = on;
ent_create("sword.mdl",my.x,attach_weapon);
if(key_q==1)
{
ent_morph (me, char2);
ent_morph (you,char1);
}
wait(1);
WHILE (1) {
handle_player1_gravity();
handle_player1_movement();
handle_camera();
handle_player1_animation(1);
wait(1);
}
}