I'm new to JS and doing a project with user-npc interactions using A-Frame with the following scenario:
Is there a way to play each part separately, or only if I call the npc interaction function in the 'animationend' event of the door?
Sorry if any bad english, I'm quite rusty.
Technically you could use await
to "pause" the execution of javascript until some Promise is fulfilled, but that's probably an awkward way to go about it. In A-Frame especially, something like this would usually just be done with emitting events after each of those steps and listening to them individually to act on them.