SetActive not working with actor's GameObject

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ronia
Posts: 5
Joined: Thu Mar 04, 2021 7:17 am

SetActive not working with actor's GameObject

Post by Ronia »

HI,

I'm using some sequences to do my cutscenes. In the last sequence I put a SetActive commad to deactivate the GameObject of an actor. This GameObject have a Dialogue Actor component, and the GameObject's name is the same of the actor: "Alex". I'm not sure if this somehow influence, but I suppose because if I SetActive any other GameObject it deactivate correctly.

I'll let some extra information in case it helps:
-When SetActive is called "Alex" is the listener.
-Alex is playing an Animation (walking)
-Last Sequence:
Actor: Rene
Conversant: Alex
Sequence:

Code: Select all

SendMessage(CallEmotion, Talk);
Delay({{end}})@2;
Camera(Table, Default Camera Angles);
SetActive(Alex, false);
-Previous Sequence:
Actor: Alex
Conversant: Rene
Sequence:

Code: Select all

SendMessage(CallEmotion, Talk);
Delay({{end}})@2;
Camera(Alex Closeup, Default Camera Angles);
AnimatorPlayWait(Sitting-Idle)->Message(Done);
MoveTo(AlexExitPoint,, 3)@Message(Done);
AnimatorPlay(Walking)@Message(Done);
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetActive not working with actor's GameObject

Post by Tony Li »

Hi,

SetActive() will not allow you to deactivate the dialogue entry's speaker or listener. Your Console window should contain this warning:

Dialogue System: Sequencer: SetActive() command: subject 'Alex' cannot be speaker or listener.

If not, then make sure your Console isn't hiding warnings, and that the Dialogue Manager's Other Settings > Debug Level is still set to Warnings or Info. If you set it to Errors or None, you will miss important messages like this.

If that's not the issue (i.e., if Alex is not the speaker or listener), then set Debug Level to Info. Reproduce the issue. Confirm that you see messages like the two below.

The first message reports that the sequencer has queued up the command to play at a specific time:

Dialogue System: Sequencer.Play( SetActive(Alex, false)@0 )

The second message reports when the command actually runs:

Dialogue System: Sequencer: SetActive(Alex (UnityEngine.Transform), false)
Ronia
Posts: 5
Joined: Thu Mar 04, 2021 7:17 am

Re: SetActive not working with actor's GameObject

Post by Ronia »

Thanks for the explanation!

Then I should disable 3D model instead of the entire GameObject.

Thanks also for the warnings advice. I had it disabled. Now I can see the Dialogue System warnings.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: SetActive not working with actor's GameObject

Post by Tony Li »

Glad to help!
Post Reply