Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

hwo to prevent rotation after hitting an object in unity

private void OnCollisionEnter(Collision collision)
{
	GetComponent<RigidBody>().freezeRotation = true;
}
 
PREVIOUS NEXT
Tagged: #hwo #prevent #rotation #hitting #object #unity
ADD COMMENT
Topic
Name
6+4 =