Script help! Please help, my scripts become values?
Posted: Sun Dec 20, 2009 3:06 pm
Ok, what happens is my scripts become the values that they are worth. Exampe:
I type 'scene.my.speed = 0.0' in the console.
Then I type '(e)=>{scene.my.speed = 2.5}' in the on-collide section of a polygon.
Then, I make a vehicle, and type 'scene.my.speed' in the motor speed section of the hinge, so that the speed of the vehicle is equal to the value of the variable 'scene.my.speed'.
So, the speed of the vehicle is 0.0 at the start, and should become 2.5 when the polygon collides. But this doesn't happen. Instead, when I type 'scene.my.speed' in the motor speed section, the motor speed becomes 0.0, and is no longer scene.my.speed, so it doesn't change to 2.5 when the polygon collides. Why does this happen? And more importantly, how can I fix this?
I type 'scene.my.speed = 0.0' in the console.
Then I type '(e)=>{scene.my.speed = 2.5}' in the on-collide section of a polygon.
Then, I make a vehicle, and type 'scene.my.speed' in the motor speed section of the hinge, so that the speed of the vehicle is equal to the value of the variable 'scene.my.speed'.
So, the speed of the vehicle is 0.0 at the start, and should become 2.5 when the polygon collides. But this doesn't happen. Instead, when I type 'scene.my.speed' in the motor speed section, the motor speed becomes 0.0, and is no longer scene.my.speed, so it doesn't change to 2.5 when the polygon collides. Why does this happen? And more importantly, how can I fix this?