Quantcast
Viewing all articles
Browse latest Browse all 98

Answer by shriya

Rigidbody constraints are managed through scripts as mentioned below. rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; A list of all the defined RigidbodyConstraints can be found here: http://docs.unity3d.com/ScriptReference/RigidbodyConstraints.html Another example, say you wanted the object to only move along the 'X' axis and rotate on the 'Y' axis. You would do: rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ; If you want to freeze rotation and position completely use "Freeze All" command. Hope it helps

Viewing all articles
Browse latest Browse all 98

Trending Articles



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