I have a quest that starts in one scene but the return node is an NPC in another scene. To track the spawn on the NPC, I found a post on your forum with this code:
Code: Select all
using UnityEngine;
namespace PixelCrushers.QuestMachine
{
public class SpawnOnStart : MonoBehaviour
{
public StringField questID;
public QuestState requiredState = QuestState.Active;
public GameObject prefabToSpawn;
// Start is called before the first frame update
void Start()
{
if (QuestMachine.GetQuestState(questID) == requiredState)
{
Instantiate(prefabToSpawn);
}
}
// Update is called once per frame
void Update()
{
}
}
}
Code: Select all
Quest Machine: GetQuestState(findDan): Couldn't find a quest with ID 'findDan'.
Thank you in advance.