Page 1 of 1

disable movement on other object

Posted: Mon Jun 15, 2020 3:24 pm
by annathehank
Hi, I'm trying to use the dialogue system to swap between playable characters.
I have it so that clicking on one game object will turn on the script that allows movement.
However, I'm trying to figure out how to turn off the movement on the other game object. I tried setting it to deactivate when the new object is triggered, but that just makes the whole game object disappear.
Is there any way to use the disable/enable component option but for a different object's script?

Thank you

Re: disable movement on other object

Posted: Mon Jun 15, 2020 3:40 pm
by Tony Li
Hi,

You can assign any component to the Dialogue System Trigger's Actions > Set Components Enabled/Disabled list. To assign a different GameObject's component, you may want to open two Inspector views. Inspect the Dialogue System Trigger. In one Inspector view, click the lock icon to lock the view on the Dialogue System Trigger. Then inspect the other GameObject; it will appear in the second Inspector view. You can drag a component from the second Inspector view into the Dialogue System Trigger's Set Components Enabled/Disabled section.

Alternatively, you can use a scene event in a conversation (see the tutorial) or use the SetEnabled() sequencer command.

Re: disable movement on other object

Posted: Mon Jun 15, 2020 3:58 pm
by annathehank
Oh my gosh! Thank you!!! I never knew you could have two inspector windows open!!!!

Re: disable movement on other object

Posted: Mon Jun 15, 2020 4:01 pm
by Tony Li
Glad to help! :-)