Hi all!
My class group is struggling with finding our current error. We are trying to have our player collide into a game object which triggers an entry into a journal. We are getting the error NullReferenceException: Object reference not set to an instance of an object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FirstPersonController : MonoBehaviour
{
public GameObject dialoguePanel;
public GameObject infoText;
public GameObject journalPanel;
public GameObject Pots;
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "InfoGiver")
{
ShowDialoguePanel();
//print(other.gameObject.name);
//dialoguePanel.SetActive(true);
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
if (other.gameObject.name == "Pots")
{
infoText.GetComponent<UnityEngine.UI.Text>().text = "Bob: \"I work at the farm here in town as a horsehand. I'm sad to see our dear llama missing.\"";
}
Are there any evident errors in this text that we are not noticing?
Thank you in advance for any suggestions you may have!