Original Discord Post by palak._.s | 2024-07-03 20:57:13
I added a trigger so that the avatar says a welcome message to the user. However, I am encountering an error and the narrative isn’t working.
Images:
Original Discord Post by palak._.s | 2024-07-03 20:57:13
I added a trigger so that the avatar says a welcome message to the user. However, I am encountering an error and the narrative isn’t working.
Images:
Reply by k3kalinix | 2024-07-03 20:59:01
<@&1163218322200989806>
Reply by raghuvanshagarwal | 2024-07-04 08:13:22
Hi Palak, sorry for the inconvenience, can you share the full log to us for better context
Reply by palak._.s | 2024-07-04 08:51:29
sure
Reply by raghuvanshagarwal | 2024-07-04 09:19:39
Hi <@1250383781031051294> can you change the SetActiveConvaiNPC inside ConvaiNPCManager to this
{
if (activeConvaiNPC != newActiveNPC)
{
if (activeConvaiNPC != null)
// Deactivate the previous NPC
activeConvaiNPC.isCharacterActive = false;
activeConvaiNPC = newActiveNPC;
if(updateLastHitNPC)
_lastHitNpc = newActiveNPC;
if (newActiveNPC != null)
{
// Activate the new NPC
newActiveNPC.isCharacterActive = true;
Debug.Log($"Active NPC changed to {newActiveNPC.gameObject.name}");
}
OnActiveNPCChanged?.Invoke(newActiveNPC);
}
}
After that, inside NarrativeDesignTrigger change the InvokeSelectedTrigger to this
{
if (convaiNPC != null && availableTriggers != null && selectedTriggerIndex >= 0 && selectedTriggerIndex < availableTriggers.Count)
{
string selectedTriggerName = availableTriggers[selectedTriggerIndex];
ConvaiNPCManager.Instance.SetActiveConvaiNPC(convaiNPC, false);
onTriggerEvent?.Invoke();
convaiNPC.TriggerEvent(selectedTriggerName);
}
}
It should solve the problem
Reply by raghuvanshagarwal | 2024-07-04 09:20:02
or if you need further help, we can get on a call
Reply by palak._.s | 2024-07-04 09:43:52
ok i will make the changes and get back to you
Reply by palak._.s | 2024-07-04 10:09:25
its working now thanks
This conversation happened on the Convai Discord Server, so this post will be closed.