Answers for "UNITY2D collide no rotation"

C#
1

how to stop player rotating when hit by object

//Set freeze rotation on the rigidbody to true.  This will stop the object from
//physics calculations randomly rotating it when hitting other colliders, but 
//will still let you rotate your player by using the transform
_RigidBody2D.freezeRotation = true;
Posted by: Guest on June-21-2020
0

hwo to prevent rotation after hitting an object in unity

private void OnCollisionEnter(Collision collision)
{
	GetComponent<RigidBody>().freezeRotation = true;
}
Posted by: Guest on June-19-2020

C# Answers by Framework

Browse Popular Code Answers by Language