- Home /
Run script on rigidbody awake?
I have some rigidbodies that are set to sleep when the game starts, after the player hits them and they awake I want to turn a boolean on and increment the score, I know I need to do this in an if statement,
if (rigidbody awake && !hit)
then do this .etc
How do I test for wether the rigidbody is awake or not?
thanks
Comment
Best Answer
Answer by qJake · Jul 20, 2010 at 08:16 AM
http://unity3d.com/support/documentation/ScriptReference/Rigidbody.IsSleeping.html
if (!rigidbody.IsSleeping())
{
// Do stuff here
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613065223im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how do you tell if a rigidbody is awake 1 Answer
How to stop rigidbody.sleep() 2 Answers
Change rigidbody transform without waking rigidbody? 0 Answers
Prevent iPhone from going to sleep during play 1 Answer
Dissapearing Rigid bodies on Sleep 0 Answers