Im having a problem with RigidbodyConstraints.FreezePositionX
When I execute it it unfreezes the rotation of my player
Here is my script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class End : MonoBehaviour
{
public GameObject player;
private void OnTriggerEnter(Collider other)
{
Rigidbody rb = player.GetComponent<Rigidbody>();
rb.constraints = RigidbodyConstraints.FreezePositionX;
}
}
“player” is my player and the Rigidbody is attached to the player