Beginner needs Help!
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(); } } } } }
Answer by AliKhan_1018 · Feb 16, 2018 at 08:10 PM
I'm a beginner myself so im not sure but i think u have to assign values to the bools like true or false.
Your answer
Follow this Question
Related Questions
Can't change light colour. 1 Answer
Help with Script 0 Answers
Having trouble deleting objects from a list after they reach a certain scale. 0 Answers
How can i run a script with a single key press? 1 Answer
Having transitions between two VideoPlayers triggered by clicking "x" times in a text layer 0 Answers