Page 1 of 1

Assigning actor in scene to enemy prefab?Or something else?

Posted: Sun Jul 21, 2019 1:23 am
by nubbinownz
So maybe I'm going about this all wrong, but right now I'm trying to accomplish a conversation trigger that starts when an enemy is killed.

Currently, the main Actor is already placed into the scene when it starts up.
A trigger zone starts the initial conversation, which then activates an object that the player has to pickup. Once the player picks up the object, it triggers another conversation which then sends a message to the enemy spawner to instantiate the enemy prefab. The way I'm trying to get it to work is to have a trigger OnDestroy set on the enemy that triggers the next conversation.

So far I haven't been able to get it to trigger. I can't assign the main actor to the "Conversation Actor" because he's already in the scene and not a prefab that's being created.

I'm still pretty new to both unity and the dialogue system, so I don't know if it's not triggering because of the missing conversation actor, or just something else I'm doing wrong.

In fact, I don't even know if this is the best way to go about doing this or if there is a better way to "track" the enemy dying ( besides putting the on destroy trigger on him)

Any help here would be very much appreciated.

Re: Assigning actor in scene to enemy prefab?Or something else?

Posted: Sun Jul 21, 2019 8:55 am
by Tony Li
Hi,

Add a Dialogue Actor component to your player prefab. Select the dialogue database's player actor from the dropdown.

If Dialogue System Trigger's Conversation Actor field is unassigned, it will look for a GameObject that has a Dialogue Actor component whose dropdown matches the conversation.

Re: Assigning actor in scene to enemy prefab?Or something else?

Posted: Sun Jul 21, 2019 12:43 pm
by nubbinownz
Awesome, thank you so much.

Re: Assigning actor in scene to enemy prefab?Or something else?

Posted: Sun Jul 21, 2019 1:08 pm
by Tony Li
Glad to help!