The problem probably is that you, Funeral, did not adjust the variable
var forceThreshold = 0.1;
as Xarthor suggested. Try a higher value. I think I use a similar approach with a threshold of "0.3".
yes i did tried with higher and lower values..
joy_force probably isn't the cause of the problem it more than likely lies somewhere else in your code.
simple test: create a level that only rotates a simple object and see if the problem continues
#include <acknex.h>
#include <default.c>
action the_player(){
while(me){
vec_to_angle(my.pan, vector(sign(joy_force.x),sign(joy_force.y),0));
wait(1);
}
}
void main(){
wait(1);
level_load(NULL);
ent_create(CUBE_MDL, vector(150, 0, 0), the_player);
}
if you still have the problem display joy_force.x and .y to determine if they're not resetting and what their values are
...
DEBUG_VAR(joy_force.x, 20);
DEBUG_VAR(joy_force.x, 20);
if these are showing there's still problems try it with a different joypad. if these aren't the problem post some more of your code as the problem is elsewhere
hmm yes maybe, there's a camera code that also uses "vec_to_angle" maybe that is?
this is the code:
var distance, angle;
VECTOR temp;
distance = 200;
while(1)
{
if(player)
{
camera.x = player.x-distance*cos(angle);
camera.y = player.y-distance*sin(angle);
camera.z = player.z+20;
vec_set(temp,player.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);