How do I attach a jumpscare animation to the player

I’m making a horror game using horror engine and I want to make a chase sequence where if the enemy catches you it’ll trigger a jumpscare. The only problem is I have know idea on how to do that. The effect I trying to go for is like Fnaf or Poppy Playtime, like something directly in the players face.

depending on which configuration you wanted you could Attach either the ScaringActor to the Player, or attach the Player to the ScaringActor

so the steps would be for the one being attached to you would give the SkeletalMesh a socket (open the SkeletalMesh Asset in the Content Browser/Drawer-> go to the Bone/Rig hierarchy, pick the bone that will be moving the other actor, right click and “Add Socket”) being sure to give it a meaningful name.
then right before the animation for your “jump Scare” is to play, disable the players movement input, then call AttachActor()(which one of the arguments/pins will be the name of that socket you added) and play your animation or pair of animations (a “child actor” can still animate independently).

if this is not a “death” then be sure to DetachActor() and re-enable player movement input, so that standard animations and movement can continue.

Could this be done purely in BP, because I don’t know how to code. I also barely understand BP so if you could be as hand holdy as possible that would be appreciated.

everything i mentioned in my previous post is completely doable in blueprints, some of it is even advised to do in blueprints instead of C++ (like names of sockets can change throughout the project, and assigning it in blueprints means that a full code re-compile isn’t needed to change a string…)

adding a socket I cover.
attach actor you just need to get the other actor some how: collision, some kind of trace, GetActorOfClass()/GetAllActorsOfClass() (this last one should be avoided if possible as with higher actor counts in your level it can have very poor performance especially in blueprints)

the hardest part will be figuring out the offset for your socket, because Attach actor will attempt to put the origin of the actorBlueprint at the socket (the default origin of an Unreal Pawn/Character is in between the feet :slight_smile: )

at the same time I have given you the overview of the steps, and would suggest to try to accomplish the steps to the best of your ability by just trying things that sound similar, and then look up a guide/tutorial if you can’t figure it out. then if there is something specific you can’t figure out that a solution doesn’t come up with a google search (try re-wording your search a few times) like your “jumpscare animation to the player” could be searched as “unreal engine Play animation on another actor” and if you want to be sure it is in blueprints then specify that.

TBH: it is the C++ portion that typically needs to be specified unless the system/mechanism is C++ exclusive anyways.

Hey there @Netherlord99! Gardian nailed it here. If you’re looking to attach the characters (either enemy to your face or your face to the enemy) you are probably going to handle it by socket attachment or tandem animations if it’s multiplayer. Here’s 2 videos, one that goes over how to make a socket and attach things to it (this one’s for weapons but you’d do the same there and just disable player input during), and the other goes over tandem animations between 2 actors. You may want to sit down and watch through both before deciding on your solution.

Disclaimer: One or more of these links are unaffiliated with Epic Games. Epic Games is not liable for anything that may occur outside of this Unreal Engine domain. Please exercise your best judgment when following links outside of the forums.

Thank you I really appreciate it

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.