Page 1 of 1

Switching on game objects on a dialogue entry

Posted: Tue Aug 13, 2019 2:40 pm
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.

Re: Switching on game objects on a dialogue entry

Posted: Tue Aug 13, 2019 2:50 pm
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.

Re: Switching on game objects on a dialogue entry

Posted: Tue Aug 13, 2019 3:02 pm
by lostmushroom
Thanks! I was trying to use SetEnabled for a game object.

Re: Switching on game objects on a dialogue entry

Posted: Tue Aug 13, 2019 3:54 pm
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.