Page 1 of 1

System Events not firing events for instantiated player prefab

Posted: Thu Jun 16, 2022 11:38 pm
by Pinwizkid
Total newb here with the first of probably many questions! Appreciate any help =)

I'm just getting some basics out of the way and am trying to get the Dialogue System Events component to disable my player's movement when a conversation starts and re-enable it when a conversation ends. I'm trying to this by disabling/enabling the bool enabled setting on the player's movement script. It seems like I have everything set up properly in the inspector, but it's just not working.

I think it might be related to the fact that my player is instantiated into the scene and is not part of scene hierarchy.
I tried dragging both the prefab from the project window and then also the player game object from the hierarchy (when the prefab is open) but neither seems to fire off the events. Manually disabling my script while playing does work so I know I'm hitting the right script to disable movement.

Any ideas what I could be missing? Seems very basic but I can't get it to work. Thanks!

Re: System Events not firing events for instantiated player prefab

Posted: Fri Jun 17, 2022 7:32 am
by Tony Li
Hi,

Dialogue System Events should work fine with player prefabs. The most likely culprit is that the scene instance of your player prefab isn't being used as the conversation's actor. Don't assign the prefab itself to your Dialogue System Trigger's Conversation Actor field. Instead, leave that field blank, and add a Dialogue Actor component to the prefab. Set the Dialogue Actor's Actor dropdown to Player.

You can find more details here: Character GameObject Assignments
and in the Interaction video tutorial.

Re: System Events not firing events for instantiated player prefab

Posted: Sat Jun 18, 2022 5:20 pm
by Pinwizkid
Thanks! Adding the dialogue actor component to the player and removing the player prefab from the Dialogue System Trigger Component > Actions > Start Conversation panel fixed the issue.

Re: System Events not firing events for instantiated player prefab

Posted: Sat Jun 18, 2022 9:49 pm
by Tony Li
Great! Glad to help.