Page 1 of 1

custom SequencerCommand's GetSubject(0)

Posted: Fri Apr 02, 2021 8:18 pm
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.

Re: custom SequencerCommand's GetSubject(0)

Posted: Fri Apr 02, 2021 10:04 pm
by Tony Li
Ah, understood. An alternate solution is to disable the DialogueActor component. This will unregister it immediately.