1. Add a QuestGiver component to a GameObject, and assign quests to it.
2. Add a script with a Start() method similar to this:
Code: Select all
void Start()
{
var questGiver = GetComponent<QuestGiver>();
for (int i = questGiver.questList.Count - 1; i >= 0; i--) // Loop down in case quests are deleted from list.
{
// Flip a coin:
if (UnityEngine.Random.value < 0.5f)
{
var quest = questGiver.questList[i];
questGiver.GiveQuestToQuester(quest, "Player"); // Give quest to QuestJournal whose ID is "Player".
}
}
}