- Home /
How to stop rigidbody.sleep()
Lets say i have an object mid-air and is sleeping [["rigidbody.sleep()"]] how could i make it awake again and move to where it needed to move to its physics (Lets say it needs to move downward, because its up in the air)
Is there a function i am missing?
Answer by pheash · Jun 24, 2012 at 03:09 PM
rigidbody.WakeUp(); will force it to wake back up. more info can be found in the reference: http://unity3d.com/support/documentation/ScriptReference/Rigidbody.WakeUp.html this will reactivate physic calculations and if its using gravity it will fall to the ground
Thanks! I really need to look at the script reference more often!
Answer by NathanJSmith · Aug 20, 2019 at 09:40 AM
You can set Rigidbody.sleepThreshold to 0 to disable rigidbody sleeping feature.
m_Rigidbody = GetComponent<Rigidbody>();
m_Rigidbody.sleepThreshold = 0.0f;
Your answer
Follow this Question
Related Questions
Manually check collision ? 1 Answer
Getting 'Real' behavior through physics settings 1 Answer
Physics: Grab Object and Swing Freely Relative to Mouse Cursor 0 Answers
Stop Rigidbodies From Overlapping 4 Answers
swapping out an object on collision 2 Answers