I’m working on a door that shuts when the player hits a collider that’s near it. I wrote a script that doesn’t get any errors and works, but the door still wont rotate.
here is the script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DoorClose : MonoBehaviour {
public GameObject Trigger;
public GameObject Door;
public GameObject Player;
public Transform Dooor;
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
Debug.Log("IT WORKS!!");
Dooor.transform.Rotate(0, 60, 0);
}
}
}
any help would be appreciated.
it still doesn't work. I should have mentioned that I tried that before. the script in on the trigger if that helps.
– BlazerLazer