[SOLVED] Door not automatically opining (part 1)

Hello there I new to Unity

I’m trying to get a sliding door to open based on how close the player is to said door
here’s the door script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Door_script : MonoBehaviour
{
bool character_nearby;
GameObject player;
void Start ()
{

}




    void OnTriggerEnter(Collider other)
    {
        if(other.gameObject == player)
        {
            Debug.Log("character_nearby");
            character_nearby = true;
        }
    }
    void OnTriggerExit(Collider other)
    {
        if(other.gameObject == player)
        {
            character_nearby = false;
            Debug.Log("character_nearby");
        }
    }
}

the Door in question is a preset from a sci-fi template
BTW I couldn’t get the Help Wanted Tag to work

Your issue is you never define what the player is.

I would instead change the tag of the player to Player and do a CompareTag check. That way you won’t need to set the player gameobject.

That all said, none of this code will open the door. Just log that you’re close to it.

oh well that may explain why the door didn’t automatically work then