VR controller button play animation in scene

Hi,

Is there a tutorial somewhere for triggering an animation to play when you press a VR button on Oculus?
Not hand animations, an animation on an NPC in the VR scene that plays when you press the trigger button on the controller (can be any button on the controller)

Thanks

Hey there @Paula_Clark1!

So this is a case, I think, where you’ll want to use an animation montage. Do you know how to set up an input on your player? You’ll use that input, use an interface or dispatcher to the character you want to perform the animation (provided it’s not the player itself).

Here’s some documentation on anim montages

And in case you need a refresh or are brand new to interfaces/dispatcher (choose one or the other for this).

Hope this helps! Get back to us with any more information if this stuff doesn’t help!

Hey @Mind-Brain, Thanks for replying so quick!

We are using the interface method so good to know we are partly on the right track!

With collision boxes, how do we look for a VR Pawn entering that space? Is there a way that works with teleporting into the collision space or would we need to add locomotive the the joystick?

Playing the montage from mouse button click, how would we map that instead to a VR controller button?

Of course Paula_Clark1! No worries!

So with the collision boxes you’ll want to look at your teleport code and on the “Set Actor Location” you’ll set the checkbox for “Sweep” to true. This will make sure overlap events between point A and point B happen when you teleport.

For the playing the montage, you would determine what the button would be considered for that specific VR headset. Next you’ll set up an Input for it. To do this, go to the top bar and click Edit>Project settings, type “Input” into the search, and create a new input. Then find your button in the drop down.

Once that’s done, close that window and go where you have your mouse button event, then do “InputAction Event”. It’ll be a red event node. :slight_smile: Then just use that instead of the mouse click!

Let us know how that goes and if you have any questions! A picture is worth 1000 words :smiley: