- Home /
Changing Force of object
I need help trying to change the force of an object at a certain point. For example (-22.5, 0, 0). It would be a real help if you can help me with my problem.
Without more details...a script or a better description...it is hard to answer your question. Objects don't have 'force'. Force is applied to objects. Objects have velocity. You can change the velocity directly:
rigidbody.velocity = Vector3(-22.5, 0, 0);
This will cause an immediate setting of a new velocity.
Answer by fardinnn · Aug 08, 2013 at 12:58 AM
if you want calculate force : if the gravity on your object is on it alter a force with formula f=MG that G can have (G.x,G.y,G.z) then you can compute your force like this : F = (-22.5,0,0)-(MG.x,MG.y,MG.z) at default G = (0,-9.81,0) M = Mass , G = Gravity
if you want script :
see http://docs.unity3d.com/Documentation/ScriptReference/ConstantForce.html and http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.AddForce.html
Your answer
Follow this Question
Related Questions
Why is Unity deleting my prefabs!? 1 Answer
2D Border doesnt allow the nutbomb gameobject to bounce 0 Answers
Object reference not set to an instance of an object 0 Answers
camera movments fixed.. character controller without using character controller -.-' 2 Answers
works well On computer but not on phone,reads well on computer but not on phone 0 Answers