moving the character!

Posted By: arashdj71

moving the character! - 08/01/08 19:07

hello!
i want to moving my character by left and right arrow keys in ent_move!
my script:

var video_mode=7;
var video_depth=32;
var move_vec[0];
action player_move
{
player = me;
wait(1);
while (me!= NULL)
{
move_vec[2] = (key_cuu - key_cud)*3 *time;
player.pan += (key_cul - key_cur) * 4 * time; // placed here just before ent_move
ent_move(move_vec,NULLVECTOR);
wait(1);
}
}

function main()
{
level_load("level_1.wmb");
wait(1);
/////CAMERA/////
fps_max=50;
while (1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
wait(1);
}
}

but before runing showing this error:

tahnk you!
Posted By: alves

Re: moving the character! - 08/01/08 19:59

You have created an array of only one value, then not there is move_vec [2].

To use the move_vec [2], it must create an array of 3 values, thus: move_vec [2];

Now you have:
move_vec [0]
move_vec [1]
move_vec [2]
© 2023 lite-C Forums