How do I add a relative force to the bottom of a cube?
Hi, I'm moving a cube and need to add a relative force, but it needs to be applied to the bottom of the cube otherwise it'll be pushed over. I know you can use AddForceAtPosition() - but I want to use AddRelativeForce() - relative to the cube's coordinate system.
Have you looked at vector3 reference? Sounds to me like you can use use vector3.up
Ah sorry, I must have not explain this correctly. I'm trying to move the cube forwards, across the platform. But adding a relative force applies at the center of the cube, which causes it to topple over. I want to add a forward force to the bottom of the cube to prevent this.
You don't have to add force from the bottom to prevent toppling. You could lock the Z axis on the inspector, or un check to prevent the force being applied to that axis.
Answer by fredz0004 · Nov 30, 2015 at 03:07 PM
Take a look at this screenshot. Lock the axis you don't want the force to be applied to. I believe it should be the Z axis.
I hope this helps.
Yeah I could do that, but there are times when I want the object to rotate, like when it falls off the platform. What I really want to do is lower the center of gravity.
Your answer
Follow this Question
Related Questions
Apply a force that is offset and rotated (diagrams included) 1 Answer
Unity2d AddRelativeForce Behaves Randomly 0 Answers
left force right force 0 Answers