- Home /
Tried unsuccesfully many tips, vectorial force will keep adding to my object
I try to make a simple physics simulation, and for that I am trying to apply to my object a vectorial force. Usually, my object should move as much as the vector described allows, but because of some reason or another it would keep moving.
void Update () {
if (Input.GetKeyDown (KeyCode.Space))
rb.AddForce(new Vector3(1f,0f,0f),ForceMode.Impulse);
}
So, I am expecting my object to move 1 unit along the x-Axis. Is it right?
As you could see, I have tried a lot of tips on this FAQ, but it does not fix my problem. To be more specific, my UseGravity=true, Drag=0, Mass=1.
Could somebody explain me whether I perceived the whole thing wrong, or is it anything to do with my code?
Answer by doublemax · Dec 05, 2016 at 09:46 AM
So, I am expecting my object to move 1 unit along the x-Axis. Is it right?
No. It applies a force which will then accelerate the object. Unless there is any other force slowing it down, it will continue to move in that direction for ever (like in outer space). Increase the "drag" if you want it to slow down on its own.