How would I call an event in blueprint to make my AI character simply slide in the opposite direction its facing?
I’m trying to do this without aimoveto node because I don’t want the character to turn, only move back while facing the same direction
How would I call an event in blueprint to make my AI character simply slide in the opposite direction its facing?
I’m trying to do this without aimoveto node because I don’t want the character to turn, only move back while facing the same direction
You can do it a couple different ways. First, try searching for Use Controller Desired Rotation and/or Orient Rotation To Movement (I think thats the one) in the actor Details. This will make the character not face the direction they are traveling. If you need them to normally face the direction they are moving, then you can just temporarily toggle it at the exact moment he moves back and then reverse it back when he’s done (make sure to use a delay or some way to know when he’s done).
The other way is less than ideal, but still a way. You could create an animation using a level sequencer, animate him moving back (his global control), then bake it as an animation sequence. Then open the animation sequence, tick enable root motion (so he will stay where he is once the animation finishes instead of popping back). Then create an anim montage from that animation sequence and then simply play the montage in the blueprint.
Thanks for the reply, yes I have found those nodes you mentioned, I will see if I can use them. Do I need to use an AiMoveTo and these nodes together somehow?
I wanted to add some more detail to what I’m trying to do. I just want to set the actor location back a small distance, opposite of the direction it is facing. I need to use a sweep to make sure the actor does not clip through the walls. It is basically for when a push character function. Like my character shoved the Ai backwards. I have an animation for the stumbling backwards and then it blends into the move forward animation.
I have tried a few things but I can’t seem to get the result I’m looking for.
For Context, a rough example:
It has just occurred to me as I posted this, that I could also choose to send a line trace backwards and get that location. However I will still need to figure out how to send it backwards from the direction the Ai is facing.
Figured it out after much thought. I made an arrow in the blueprint, attached it to the capsule component, get its world location and then set that location in a vector variable.
Then when I play the timeline, it lerps from my actors currently location to the set variable location. This way every time a pushback event is triggered it will grab a new location and move it there.
I’m glad you found a solution!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.