Answers for "how to freeze position in unity with script"

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

Code answers related to "how to freeze position in unity with script"

C# Answers by Framework

Browse Popular Code Answers by Language