[SOLVED]Trigger A spawn

Announcements, support questions, and discussion for Quest Machine.
Post Reply
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

[SOLVED]Trigger A spawn

Post by mschoenhals »

What would be the best way to trigger a spawn or enable a gameObject (enemy) using Quest Machine? I would like a spawn to be triggered when a player enters a particular area (OnTriggerEnter).

Thanks in advance.
Last edited by mschoenhals on Tue Sep 15, 2020 8:02 am, edited 1 time in total.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trigger A spawn

Post by Tony Li »

Hi,

- To spawn when the player enters a trigger collider, use a Trigger Event component. You can configure it to turn on a Spawner, or activate an inactive GameObject. Or, since I think you're also using the Dialogue System integration, you can set a Dialogue System Trigger to OnTriggerEnter. This way you can set the Dialogue System Trigger's Conditions to only fire if certain conditions are true, such as if a quest is active.

- If you want it to spawn when a quest enters a specific state, use the Activate GameObject or Instantiate Prefab Quest Action.
mschoenhals
Posts: 118
Joined: Thu Dec 19, 2019 7:38 am

Re: Trigger A spawn

Post by mschoenhals »

Ok, that worked perfectly (and easier than I thought). :D
Thanks Tony!
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: [SOLVED]Trigger A spawn

Post by Tony Li »

Glad to help!
Post Reply