Answers for "unity how to lock rotation"

C#
5

unity how to lock rotation

public float lockPos;

	void Update()
	{
		// Locks the rotation.
		transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, lockPos, lockPos);
	}
Posted by: Guest on September-23-2020

C# Answers by Framework

Browse Popular Code Answers by Language