Switching on game objects on a dialogue entry

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lostmushroom
Posts: 185
Joined: Mon Jul 01, 2019 1:21 pm

Switching on game objects on a dialogue entry

Post by lostmushroom »

Is there a way to switch on game objects or components on a particular dialogue entry? I would like to have a particle system switch on when you get to a certain point in conversation.

I guess it might be something in Sequence, but I'm not sure what.
User avatar
Rallix
Posts: 15
Joined: Mon Jul 08, 2019 9:02 am

Re: Switching on game objects on a dialogue entry

Post by Rallix »

How about SetActive() sequence for gameobjects and SetEnabled() for components? ;)
There's also an example for queuing an explosion particle effect until you send a message to trigger it.
lostmushroom
Posts: 185
Joined: Mon Jul 01, 2019 1:21 pm

Re: Switching on game objects on a dialogue entry

Post by lostmushroom »

Thanks! I was trying to use SetEnabled for a game object.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Switching on game objects on a dialogue entry

Post by Tony Li »

Thanks, @Rallix!

Quick note on SetActive(): In version 2.1.10 and earlier, it can only activate GameObjects whose root GameObject is active. The upcoming 2.2.0's SetActive() can find any inactive GameObject in the scene, even if its parents are inactive all the way up the hierarchy.
Post Reply