I wanted to see if there was an easy way to get the name of a gameobject based on the dialogue actor component for use in sequence commands.
I can write custom sequence commands if necessary but was curious if there was functionality I may have missed.
Basically i have an actor John Smith and a scene gameobject with the name John and the dialogue actor component attached with John Smith set as the actor. Is there something I can do to get the gameobject name "John" for use in command subject parameters without hardcoding in "John" to the sequence call? In this example he would not be the active actor or listener for a node, but another actor in the overall conversation.
I recently changed some gameobject names tied to actors and lots of conversation code broke and so I'm looking to prevent this for future changes, if possible.
Get Gameobject name in sequence based on Dialogueactor component
Re: Get Gameobject name in sequence based on Dialogueactor component
Hi,
If your setup is like this:
If no Dialogue Actor is set to John Smith, it will search for a GameObject whose name is John Smith, giving preference to active GameObjects first, then searching inactive GameObjects.
So if you're using the dialogue database actor name (i.e., John Smith), it should find the subject even if the subject's GameObject name is just "John". You can rename the GameObject whatever you want.
However, if you renamed the dialogue database actor's Name, you'll need to update the Dialogue Actor component and references to the actor's old Name in your sequencer commands. It might be as simple as using the Dialogue Editor's Database > Global Search & Replace function to replace "John Smith" with the new name in your dialogue database.
If that's not practical, then you may need to do something custom.
If your setup is like this:
- Dialogue database actor Name = "John Smith"
- GameObject name = "John"
- Dialogue Actor component's Actor dropdown set to "John Smith"
If no Dialogue Actor is set to John Smith, it will search for a GameObject whose name is John Smith, giving preference to active GameObjects first, then searching inactive GameObjects.
So if you're using the dialogue database actor name (i.e., John Smith), it should find the subject even if the subject's GameObject name is just "John". You can rename the GameObject whatever you want.
However, if you renamed the dialogue database actor's Name, you'll need to update the Dialogue Actor component and references to the actor's old Name in your sequencer commands. It might be as simple as using the Dialogue Editor's Database > Global Search & Replace function to replace "John Smith" with the new name in your dialogue database.
If that's not practical, then you may need to do something custom.
Re: Get Gameobject name in sequence based on Dialogueactor component
Thanks! Appreciate it!