Hey there, So I’m new to Unreal Engine, but I’m trying to learn a but of how to set up a character to animate certain things under certain cercumstances.
For example:
When running full speed toward a low object, I want to give the character a chance to trip on this object. I also want this to change to a fitting animation depending on the hight of the object. I also want to add in my character reacting if they bump their shoulder into a wall or door realistically.
I also want to add in auto climbing for obsticles too short to have to use the jump key on, but not objects that are too tall.
So I want a character that can be animated very realistically. Something I can use as a template.
If this already exists somewhere I would love some info as to where I can find it. If anyone can help guide me on how I could learn this however, that would be much more benificial to me and prefered.
My goal is to create a game simular to Little nightmares/Little Nightmares 2, but with a level of complexity and realism to the animations and world interactions.
What you’re looking for is tracing in front of your character, so that you can predict the obstacle and act accordingly.
I would suggest to add a trace 1/1.5meters in front of the player, looking down, so that you can measure the height of the obstacle, then set your logic to either trip or jump on it.
Regarding walls/doors, you can do a similar thing, but where the trace goes straight, and based on what object there is in front of the player, the animation will be triggered accordingly.
In short, you need to recognize the object in front of you and build your logic accordingly, so that you can send the proper data inside the AnimBP to switch between different states and when to go ragdoll.
One more thing. Is it possible to randomize between a group of different trip/climb/jump animations for these obstacles, so they don’t look repetitive and appear more natural?
Absolutely, you could use a data table ( or multiple data tables ) where you put all your animations variations, then inside the AnimBP you just need to have the anim sequence as a variable and have an event ( maybe using the transition from one state machine to the other ) to set a random animation ( use random int ) and you’re good to go.
Thank you so much for the help. I really appreciate it!