custom SequencerCommand's GetSubject(0)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

custom SequencerCommand's GetSubject(0)

Post by fkkcloud »

Hello,

I have a newly instantiated gameObject with DialogueActor on it with proper actor name (which used to work fine in general cases).
However,

Code: Select all

GetSubject(0)
is trying to get other object from the loaded but not instantiated gameObject with just same name of it (no DialogueActor on that object).
It ignores the one that is newly instantiated even if it has DialogueActor that sets to exact Actor string name.

Any reason why?
It seems like a scene info(list of object or list of DialogueActors) did not get updated?


Edit: I tried print info level logs and it seems like the instantiated DialogueActor did not call RegisteringTransform of its own on OnEnbale at all. I don't know why

Edit2: Ok I figured it out. I was destroying the object that is registered under registeredActorTransforms with name os "AAA". But at the same time I was instantiating a new object with same Actor name "AAA".
Since I was not calling DestroyImmediate() but just Destroy(). Even thought I called Destroy() before Instantiating, it destroys the gameObject a bit later so my newly registered gameObject was Unregistered.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: custom SequencerCommand's GetSubject(0)

Post by Tony Li »

Ah, understood. An alternate solution is to disable the DialogueActor component. This will unregister it immediately.
Post Reply