- Home /
Apply low gravity only for specific object.
Hi,how can i make that this script apply low gravity to specific object (object what i want 1 or 2) not for all game object who have rigibody,but only affecting one specific object. Thanks. :)
Physics.gravity = Vector3(0, 2, 0);
Answer by robertbu · Nov 19, 2013 at 06:51 PM
Add a ConstantForce component to any object you want to have low gravity (Component > Physics > Constant Force). Then set the 'Y' value according to how much you want gravity to be damped. Try values in the 7 - 9 range to start.
Also, uncheck "Use Gravity" in their Rigidbody component. And if you want more control over what you're doing (i always prefer making a script rather than adding a component like that), you could alternatively just have this line in FixedUpdate in a script attached to that object.
rigidbody.AddForce(-Vector3.up,Force$$anonymous$$ode.Acceleration);
Your answer
Follow this Question
Related Questions
Faux Gravity Prolem? #2 2 Answers
(C#)How To Disable Gravity From Script? 4 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Player goes through ceiling when using Physics.Gravity. 1 Answer
gameObject.active Find 1 Answer