Hello! I’m looking to make a Jumpscare like seen in FNaF Security Breach or Poppy Playtime (or Choo-choo charles if you know what that is) (all UE4/5 games)
I can make the animation it’s just that I don’t know how to play it. Do I attach the enemy to the player? (AttachActorToComponent) or vice versa? Or another way to do it?
Please let me know if you have any clue. Thanks!
Hello Mr_Deblasio and thank you for posting.
Those games sure are fun.
With a few of the characters, it looks like they are chasing the player. In the enemy AI, I used pawn sensing for sight. You can use the other senses as well if you see fit. Once the AI has met the Acceptance Radius from the AI MoveTo, you can have them play an animation.
This is the most basic way of having your AI play an animation when the player gets too close. There are more reliable and slightly more in-depth methods to try.
Here is the Play Animation documentation.
Here is the main page for AI.
I hope the documentation assists you further in your endeavors.
Hi, and thank you for answering. My problem is not with triggering the jumpscare, It’s more of the animation itself. How do I make a dynamic jumpscare that moves the player or at least the camera? Can this be done by attaching components to other components? Thank you
Here is an example: Programming a 666,000 IQ Monster for my game! - YouTube (timestamp included)
Hello and thank you for the reply.
From the video you have provided, it might be fine if you used view target with blend. It will set the camera’s location.
For the player character’s camera, I would consider using the Set View Target with Blend node.
I hope this documentation provides adequate assistance.
Hmm, so would that entail having a separate, animated component on the enemy that the player’s camera always blends to when the jumpscare is active?
Hello again Mr_Deblasio.
You wouldn’t necessarily need to animate the component if your enemy already has a jumpscare animation playing. Here is what I did to make this work.
For my enemy AI: I added a camera component to the character mesh. I selected ‘head’ as its socket. This way, the camera will wobble about when the animation plays.
Then, when the enemy catches up to the player for the acceptance radius, the animation will play and it takes the player controller and sets the view mode.
This is a quick way to test if the functions work as needed. I highly recommend you look into AI behavior trees for a more refined and stable method of your AI implementation if you haven’t already.
Ohhhh, so what I can do is add a camera on the enemy that the player blends to while the animation is playing on the mesh. Thank you!