Hi
![](/ubbthreads/images/graemlins/smile.gif)
I just starded creating my own player-wovement function. The function works.
So I added a function to set a vector to the player coordinates for further purposes. This function is started by pressing space. Now, when I press Space, the c_move function stops working.
I can look around with the mouse but i can't move by pressing WASD. Here's the code:
Code:
// adjustable mouse-sensitivity and movement-speed
var mouse_sens = 5, movement_speed = 8;
// vector for further purposes
VECTOR* bla = nullvector;
...
action Spieler()
{
player = me;
while(1)
{
// ingame-actions
if(GameState == gsINGAME)
{
x = (((key_w && !key_s) || ((!key_w && key_s) * -1)) * movement_speed) * time_step; // forward and backward movement
y = (((key_a && !key_d) || ((!key_a && key_d) * -1)) * movement_speed) * time_step; // strafing
camera.pan = my.pan -= mouse_force.x * mouse_sens; // players & cameras pan
camera.tilt = minmax(camera.tilt + (mouse_force.y * mouse_sens), -80, 80); // cameras tilt
c_move(me, vector(x,y,0), nullvector, GLIDE); // players managed-movement
vec_set(camera.x,my.x); // sync camera with player
camera.z += 105; // camera to players head
frame += 1; // a simple debug counter
if(key_space)
{
vec_set(bla.x, player.x); // What the hell???
}
}
wait(1);
}
}
The "frame"-var was just a debug var to test if the movement-function is still active (added to watch-vars in SED). I also checked the movement-vectors. All is working ... just c_move not!?
Can somebody help me?