Quantcast
Channel: Answers for "Default Values for Components"
Viewing all articles
Browse latest Browse all 6

Answer by Eric5h5

$
0
0
You can use a script with the Reset function to set up defaults: function Reset () { rigidbody.useGravity = false; } @script RequireComponent(Rigidbody); When you add that script to an object that doesn't have a rigidbody, one will be added, and the gravity is turned off at the same time. If an object already has a rigidbody, adding the script will turn gravity off. Also gravity is turned off if you choose the Reset context menu item.

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>