AddForce and Momentum
Hi guys.
I have a problem with the Physics Engine. Few days ago I started working with Physics, so maybe this is a stupid question.
I have a drone, with different gameobjects as children, rotor 1, rotor 2, etc., every gameobject has its own Rigidbody with gravity enabled.
I want to drive the drone using AddForce, but it seems that it doesn't generate the momentum. For example, if I use add force only on one rotor (so it shouldn't be balanced) the drone remains parallel to the ground and this is irrealistic.
Can anyone help me please?
Thank in advance.
try Rigidbody.AddForceAtPosition( ... ). It should give you a more pleasant result. http://docs.unity3d.com/ScriptReference/Rigidbody.html
Thank you for your reply.
I have already done some experiments with AddForce, AddForceAtPosition, AddRelativeForce but no one works.
This is my simple code:
Vector3 t = Physics.gravity * total$$anonymous$$ass;
//rotor1.AddForce(- t / 4f);
//rotor2.AddForce(- t / 4f);
//rotor3.AddForce(- t / 4f);
rotor4.AddForceAtPosition (- t, rotor4.transform.position);
With this code, applying ALL the force on the rotor 4, the drone stay in equilibrium and I don't understand why.
Answer by Zipe92 · Dec 29, 2015 at 12:42 PM
I figured out what is the problem!
The drone model that I'm using have a very bad mesh, every mesh in the drone has the center in the center of the drone, so AddForce applies a force at the center of the drone and stays always in equilibrium!
Now I added other fake gameobjects in the position of the rotors and applying the force to these gameobjects it works!
Your answer
Follow this Question
Related Questions
Ball Speed is not increasing as per code 0 Answers
How do I get objects in front of the player to be blasted away? 1 Answer
How to remove addforce effect 0 Answers
AddForce in Coroutine 1 Answer
Script makes plane point in general direction but doesn't point fully... read description please! 1 Answer