SendMessage randomly stopped working for just one character

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Cynical-C
Posts: 4
Joined: Fri Jun 30, 2023 12:55 pm

SendMessage randomly stopped working for just one character

Post by Cynical-C »

I opened my project today and one of my characters is not receiving messages from sendmessage. It was working fine when I left it last night. It just seems to have randomly stopped working again today. This has happened before a few weeks ago but seemed to fix itself after I restarted the engine.

For context:
I have a sequence with characters talking. On one dialogue entry I have 3 sendmessage calls to 3 different characters.

SendMessage(SetLeft, ,Char1);
SendMessage(AddFinishWithChar3, ,Char2);
SendMessage(WalkToChar2, ,Char3);

The first 2 characters do their functions properly. Char3 does not.

I've tried restarting the engine.
All characters use the same prefab.
I've reordered the sendmessage calls in the sequence.
I've tested that other sendmessage calls to this character do not work.
I've verified that names of the functions match.
There is no error in the inspector.
I've double checked that this is the only object in the scene with the name 'Char3.'
I've deleted the character and remade them from scratch.

What did work is renaming the character transform to 'Char4' and updating the send message accordingly but I'd rather not go through all of my dialogue and rename the character. All the characters in the scene are named after their dialogue actors in the database and I'd prefer to keep it that way.

It is only this one character for some reason. Is there a special way to register an object as a receiver for sendmessage that I'm missing?

Thanks in advance for your help!
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: SendMessage randomly stopped working for just one character

Post by Tony Li »

Hi,

Are there perhaps two GameObjects named "Char3" or a different GameObject with a Dialogue Actor component that's set to Char3? SendMessage() will first look for a GameObject that has a Dialogue Actor set to Char3. Failing that, it will look for a GameObject named Char3.

Or did the method name change from WalkToChar2() to something else?

If that doesn't help, temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then reproduce the problem. The Dialogue System will log two lines to the Console. The first will look like:

Dialogue System: Sequencer.Play( SendMessage(WalkToChar2, , Char3)@0 )

The line above shows the command as the Dialogue System's sequence parser understands it. The second will look like:

Dialogue System: Sequencer: SendMessage(WalkToChar2, , Char3(Transform), )

The line above shows the GameObject that will receive the message.
Cynical-C
Posts: 4
Joined: Fri Jun 30, 2023 12:55 pm

Re: SendMessage randomly stopped working for just one character

Post by Cynical-C »

Thank you so much. There was another object in my scene with a dialogue actor component set to Char3. Changing it fixed the issue. I appreciate your help.
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: SendMessage randomly stopped working for just one character

Post by Tony Li »

Glad to help!
Post Reply