Hi All,
I'm having some trouble with c_move and negative values, and I'm hoping this is a really simple oversight on my part because I'm starting to think I'm better off working on my own collision-detection then relying on this inconsistent function.
I made a level in WED with a ball and a paddle (both MDL models) and attached a script with actions for both models, then built the level.
Paddle Action Code:
action move_paddle()
{
var pspeed = 4;
while(1)
{
If (key_a) //move left
cm_move(me, nullvector, vector(-pspeed*time_step, 0, 0), GLIDE);
If (key_d) //move right
c_move(me, nullvector, vector(pspeed*time_step, 0, 0), GLIDE);
wait(1);
}// end while
}// end action
The 'd' key works fine (moves to the right), but the 'a' key does nothing or will randomly move to the right too if I toggle the bbox flag in WED. I've also tried replacing the pspeed variable with the value "-4" in the c_move function and I get the same results. Same story with the ball action, won't move if a value is negative.
Most other c_move topics I've seen involve setting one of the _PASSABLE flags but I've tried a few of those too with the same result.
Can anyone help me with this? There has to be something I'm missing...
-Q
Last edited by GamerQ; 04/15/10 22:36. Reason: Example code correction.