I am trying to get the name of the parent so that I can determine which button is pressed. However, it gives me:
The referenced script (Unknown) on this Behaviour is missing! Although all the names of the files are the same as the name of the class.
using System.Collections;
public class Buttons : MonoBehaviour
{
private void Start()
{
Debug.Log(transform.parent.name);
}
}
Edit: After running it twice, a new error appeared:
NullReferenceException: Object reference not set to an instance of an object Buttons.Start () (at Assets/Buttons.cs:8)