- Home /
Question by
Saowi · Sep 06, 2013 at 03:57 PM ·
accelerometerstop
How to stop accelerometer when my object touches the plane/ground?
How can I stop my accelerometer when my object touches the plane or ground?
Please help, thanks!
Comment
Answer by boriswc97 · Sep 07, 2013 at 11:54 AM
Create a bool variable for example isTouchingGroundOrPlane;(You can make it shorter sure)
and to where the accelerometer works put an if(isTouchingGroundOrPlane == false) then it can happen. else it cannot happen.
and tag your platform (Plane/ground or whatever it is) and when it does a if(collider.tag == "Tag That You Put") isTouchingGroundOrPlane = true
Your answer
![](https://koobas.hobune.stream/wayback/20220613113709im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how to stop animation loop? 1 Answer
Exit playmode at runtime using code 1 Answer
How can I completely stop a script? 1 Answer
Stop momentum of a ball 1 Answer