I am using the newest version of Unity!
Right now I’m getting this? Assets/QuestTrigger.cs(33,46): error CS1061: Type UnityEngine.GameObject' does not contain a definition for
startQuest’ and no extension method startQuest' of type
UnityEngine.GameObject’ could be found. Are you missing an assembly reference?
My code right now is.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QuestTrigger : MonoBehaviour {
private QuestManager theQM;
public int questNumber;
public bool startQuest;
public bool endQuest;
// Use this for initialization
void Start () {
theQM = FindObjectOfType<QuestManager>();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D(Collider2D other)
{
if(other.gameObject.name == “Player”)
{
if (!theQM.questCompleted[questNumber])
{
if (startQuest && theQM.quest[questNumber].gameObject.activeSelf)
{
theQM.quest[questNumber].gameObject.SetActive(true);
theQM.quest[questNumber].startQuest();
}
}
}
}
}