Is it possible to play animations with triggers?

Hello hello!

I am currently tryring to play some animations with a trigger in my game, but I can’t figure out how to do this. What I am trying to do is when the player enters the trigger, the AI plays an animation which ends up in a IdleAnim and he just stands there until you leave the trigger.

I am pretty new to Blueprints but I have been trying to do this with the level BP and a Class BP for the AI( The AI is supposed to be a vendor in my game which just stands there idle when you are in the menu ). I have heard about the Behaviour Tree, but I was hoping to do this without it if thats possible.

Hopefully I explained it good enough!
thx.

I don’t know if you’re married to the idea of using a trigger to play animation, but I know of another way that may suit you well. I simply create an Box Capsule over the Actor, which can be your NPC. Then I set its collision to OverlapPawnOnly. From there I add events BeginOverlap and EndOverlap to blueprint of the NPC Actor. Lastly those will activate and deactivate the animation set to be played. This will allow you to skip the need for triggers, because I know placing them all the time might turn out to be tedious. Also if you use them, you would need an interface for the Trigger to Interact with said Actors.

I have a example of this below. I hope this works for you.

Peace

Thx alot for the help! :slight_smile:

No worries, if you ever need help let me know!

Helped me with my game too. You’re a lifesaver! :slight_smile:

Hi Peter,

I have a bit of same type of situation. I have a character which does kick animation when i press “F” key. There is another character which needs to play specific animation when hit by kick animation. My question is, can using “Play Animation” function generate hit event on the second character? As of now, I put hit event on the second character so that when it gets hit by the kick animation it plays a certain animation BUT what happens is that when the first character is close to second character and I press “F” key, nothing happens to second character and no animation is played.

Would really appreciate your help in this.

Contact me @ me - at - peterlewton.com