Answers for "unity 3d freeze position"

C#
2

freeze position unity c#

rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ;
Posted by: Guest on July-01-2020
0

unity freeze position in script

using UnityEngine;

public class FreezePosition : MonoBehaviour
{
    public GameObject TheThingToFreeze;
  	
    public void	Start()
    {
    	TheThingToFreeze.GetComponent<Rigidbody>().constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ;  
    }
      
}
Posted by: Guest on February-26-2021

C# Answers by Framework

Browse Popular Code Answers by Language