Trigger Matinee animation with specific input only when looking at object

Hi there,

I am playing around with making a simple First Person game (basically to figure out and prototype various gameplay elements). Currently I want a simple way to trigger a matinee animation via a specific key input.

I also want this animation to be triggered only when my crosshair is in line with the object. (I would guess it has something to do with line tracing? Not sure how to correctly implement it though.)

Let’s say I want to press LMB to trigger animation and then LMB again to trigger the Reverse of that animation. The animation is simply a opening and closing drawer.

How would I go about doing something like this?

Here’s a screen shot of what I have going on so far. This way the two animation are cancelling each other out. Not sure how to isolate the Play and Reverse action and set the condition for opening and closing the drawer:

Put a flip/flop after the press event. That makes it a use the same input to trigger the first thing then the second when pressed again.

I haven’t actually tried anything with matinee though so, hope it works

OK so got it to work but I have to use a box trigger to limit the animation from only executing when I’m near the object. Ideally I would only want the animation to trigger when the object is in my line of sight (and that line of sight is limited to a certain distance)?

This is how my blueprint looks now:

This should help with that.
https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/index.html