Receiving the "The modifier 'private' is not valid for this item" error. Been searching for a while and nothing seemed to work and was wondering if someone could point out something I may have missed. This is part of a Unity Tutorial and I don't know where I went wrong (sorry this is my first time posting on any kind of coding forum and thanks in advance).
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UnityStandardAssets.Characters.FirstPerson
{
public class Npc1 : MonoBehaviour
{
public GameObject triggerText;
public GameObject DialogueObject;
public RigidbodyFirstPersonController rigid;
public bool hasTalked = false;
private void OnTriggerStay(Collider other)
{
if (other.gameObject.tag == "Player")
{
triggerText.SetActive(true);
if (Input.GetKeyDown(KeyCode.E))
{
if (!hasTalked)
{
other.gameObject.GetComponent<PlayerData>().DialogueNumber = 1;
DialogueObject.SetActive(true);
rigid.enabled = false;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
triggerText.SetActive(false);
}
else
{
other.gameObject.GetComponent<PlayerData>().DialogueNumber = 1.5f;
DialogueObject.SetActive(true);
rigid.enabled = false;
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
triggerText.SetActive(false);
}
}
}
private void OnTriggerExit(Collider other)
{
triggerText.SetActive(false);
}
}
}
}