I keep gettin this error even tho the class name is same as script name.
i tried to remove script, and reimport it…
please help
here it is if needed :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Sign : MonoBehaviour
{
public GameObject dialogBox;
public Text dialogText;
public string dialog;
public bool playerInRange;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.Space) && playerInRange)
{
if(dialogBox.activeInHierarchy)
{
dialogBox.setActive(false);
}
else
{
dialogBox.SetActive(true);
dialogText.text = dialog;
}
}
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag(“Player”))
{
playerInRange = true;
}
}
private void OnTriggerExit2D(Collider2D other)
{
if(other.CompareTag(“Player”))
{
playerInRange = false;
}
}
}