System Events not firing events for instantiated player prefab

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Pinwizkid
Posts: 4
Joined: Tue Jun 14, 2022 7:18 pm

System Events not firing events for instantiated player prefab

Post 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!
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: System Events not firing events for instantiated player prefab

Post 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.
Pinwizkid
Posts: 4
Joined: Tue Jun 14, 2022 7:18 pm

Re: System Events not firing events for instantiated player prefab

Post 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.
User avatar
Tony Li
Posts: 21975
Joined: Thu Jul 18, 2013 1:27 pm

Re: System Events not firing events for instantiated player prefab

Post by Tony Li »

Great! Glad to help.
Post Reply