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