AddForce on Rigid Body with a negative vector won't move

Hello

I’m creating a game where an object will move in the direction of rotating arrow. You hit a button, the arrow stops, I gather its forward transform and apply a force to the other object.

It works perfectly except for when the arrow is pointed down and left. In this case, the forward vector of the arrow was (-0.6f, 0, -0.5f). So I hard coded it for testing.
Here’s my code…

Vector3 test = new Vector3(-0.6f, 0, -0.5f);
rigidBody.AddForce(test * thrust, ForceMode.VelocityChange);

Any time the x and z are negative, the object moves just a small fraction. All other positive / negative x / z combinations work fine.

Why would this be?
Thank you.

I guess your’re mixing up transform.forward and world coordinates. Vector3(-0.6f, 0, -0.5f) points to the fixed (2D) world coordinate -.6,-.5. You’re probably thinking of it like “move -.6 x and -.5 z”. But that’s not the case. No matter where your gameobject is, it will move to the coordinate -.6/-.5 and not into the direction -.6/-.5 (this would be a ray).

Use transform.forward of your arraow and not fixed coordinates.

Thank you so much for your reply.

That’s actually what I was originally doing. I stopped the arrow on button press and set the force vector to the forward of the arrow. It works perfectly except when the arrow is pointing down and to the left. So I logged the arrow’s forward vector at that point and it was -0.6, 0, -0.5

So I was just manually setting that as a test.