disable movement on other object

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
annathehank
Posts: 95
Joined: Sun May 03, 2020 2:17 pm

disable movement on other object

Post 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
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: disable movement on other object

Post 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.
annathehank
Posts: 95
Joined: Sun May 03, 2020 2:17 pm

Re: disable movement on other object

Post by annathehank »

Oh my gosh! Thank you!!! I never knew you could have two inspector windows open!!!!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: disable movement on other object

Post by Tony Li »

Glad to help! :-)
Post Reply