How to Trigger a Custom Animation with Blueprint When an Actor Interacts?

Hi everyone,
I’m relatively new to Unreal Engine, and I’m currently working on a project where I want to trigger a custom animation when an actor interacts with a specific object in the world (like pressing “E” near an object).

Here’s what I’ve done so far:

  • I’ve created a custom animation for the actor (e.g., a character performs a special action).

  • I have the basic input setup in the Input Bindings (e.g., pressing “E”).

  • I’m using a Blueprint to handle the interaction when the player gets close to the object.

However, I’m having trouble connecting the Blueprint with the animation. I want to trigger the animation only when the player is near the object and presses the key. I’ve tried using the “Play Animation” node, but I’m unsure how to set this up properly in the Blueprint.

Could someone explain the best approach for triggering a custom animation with a key press, or suggest any tutorials that could help me with this?

Thanks in advance!

Welcome to the forums, let me try and give you an overview of this!

This can be really involved or really simple depending on how you want to go. The simplest form of this is using the PlayAnimation node in the blueprint so that whenever you press a button an animation plays. This could be gated behind a simple check to see if you’re near an object that can be interacted with so it only plays the animation if it can be used. This method is often too simple though and can lead to problems like all bones playing the animation instead of blending properly with the normal animation sequence that’s playing.

The other aspect you could look into is animation slots this allows for better results when it comes to blending animations together. However this requires more of a setup using animation blueprints.

If neither of those things are what you need post some images of what you have so far and I (or someone else on the forums) will be able to provide more detailed help.