- Home /
AddForce ignores X and Y components
I have an object with a rigid body,collider, kinematic = false, no gravity that I apply a force with only a non-zero Z component using ForceMode.Force.
It works fine. Then at some point in its travels I apply another one time force using force mode Force and it only recognizes the Z component of the additional force. It ignores the non-zero X and Y values of the force Vector3. It doesn't work regardless of how large of value I supply for X and Y
also, it does not work regardless of which force mode I use.
can you post your code with some anotations as to what you're doing and where your having a problem
As bobadebob said, without code we cannot help. Other then the obvious: you didn't lock movement on those access of the rigidbody, right?
Thanks for the feedback. Apparently, the rigid body was constrained on the X and Y axis. I didn't even realize those check boxes were available in the inspector of a rigid body. I don't believe I set them. Problem resolved.
Your answer
Follow this Question
Related Questions
AddForce() in axis x and y not working 0 Answers
How to stop a Gameobject moving on the X axis 1 Answer
Why is my rigidbody jump height different every time, despite being in FixedUpdate. 1 Answer
2d movement 1 Answer
negative x value in Vector2 0 Answers