Iām working on an InWorld Character experience and seem to be hitting a wall when it comes to the custom InWorld Triggers.
Iām using the āconsole.log(āTrigger Receivedā, evt.trigger)ā snippet from the module doc but it doesnāt ever seem to register my custom triggers from the InWorld Character. Using the Chat feature on the InWorld Platform, I can see these triggers are being called, but just not read on the 8th wall side.
Apologies if Iām just being dense, but any help would be great. Thank you
Looking at the module documentation, it looks like youāre referring to this code snippet:
onMessage(evt) {
// Enable if you want to see what each packet being sent looks like
// console.log(evt)
if (evt.isText()) {
console.log('Text Received', evt.text)
} else if (evt.isEmotion()) {
console.log('Emotion Received', evt.emotions)
} else if (evt.isTrigger()) {
console.log('Trigger Received', evt.trigger)
} else if (evt.isInteractionEnd()) {
console.log('End of Character chat response')
}
}
Have you tried uncommenting console.log(evt) to see whether the event is coming through at all?
The best practice is to put custom Javascript inside of an A-Frame component, similar to the sample project. Also, comparing the sample project code with your code, I donāt see you calling window.inworldClient.connect() anywhere. I suggest taking another look at inworld.js from the sample project and doing something more similar to that in your project.
Ay great, thank you
Obviously didnāt take a proper look at what was already in place. Seemed to have gotten everything sorted and the trigger came though