How to fix character "flickering" after creating blendspace?

Good day. I want to make a locomotion system like in Batman arkham knight, where the movement direction attached to camera direction when you just moving and is free when you’re in fight mode. I achived that effect with use controller rotation yaw:
изображение_2022-01-12_173151
but I don’t know how to make a movement sideways. I created blendspace 2d with direction (-180;180) and speed(0;600) axis and linked animations:


Then I calculated speed and direction:

and connected it to my blendspace in state machine:

But now my character can’t walk in any way except forward (only when direction is 0). In other cases character is “blinking” or “flickering” very fast and can’t move. What am i doing wrong?

I just took a quick look at your post, but if I’m interpreting your blendspace properly, you’ve set both the right and left ninja strafe animations at 180 degrees (which is the same as -180 degrees). That’s backwards; so, in effect, you have animations at forward (0 deg) and backward (180 deg). If you want right and left animations, you need to place them at 90 degrees and -90 degrees, respectively.

And the flickering is caused because you have two different animations set for backwards.

I changed animations at 90 and -90 degrees, but nothing changed:


And I don’t understand, what you mean:

I have only idle, walking, run and strafe left/right.

Are you able to post a video of the issue?

When I said, “you have two different animations set for backwards,” I was referring to your original blendspace setup, since you had NinjaStrafeLeft set at -180 and NinjaStrafeRight set at 180. The angles of -180 and 180 are equivalent, in that they both indicate “backwards.”

I’m surprised you continue to have an issue after changing your blendspace, but that is why I’d like to see a video. Unless I missed something, your simple setup in the AnimBP Event Graph seems fine.

Also, what do you mean what you say your character can’t walk in any way except forward? Do you mean the animations don’t play, or that the character physical does not move?

Made a video of my problem.

In your video, are you holding down the input? The capsule isn’t moving much at all, and you’re not using root motion, from what I can tell. If the input is held down, the capsule should be moving more than it is.

Do you happen to be mixing root-motion animations with in-place animations? I’m confused about your problem now.

Also, the animations you have set up in your blendspace are for strafing, yet the motion you’ve allowed your character to perform is standard movement rather than strafing movement. In the Batman game you referenced, the player character moves in standard fashion in combat, and that’s what you seem to have currently allowed.

My suggestion is to make sure you are using the correct animations to fit the context. If you want to the character to perform strafing locomotion, use strafing animations. If you want the character to perform standard locomotion, use standard locomotion animations.

Hm… the walk and run are the default animations, but strafe right/left is root motion animations:
strafe:


walk:

And when I disable root motion, I always running, even if I’m going aside.

You’ll need to choose whether you want a data-driven animation system or a root-motion system. Right now you’re trying to mix both, which won’t work. (There is a time and place to have root-motion, but this is not the time and place.) The way you’ve set up the Event Graph seems like you’re aiming to use in-place animations for your system, so be sure to turn off the root motion.

And, as I mentioned earlier, you are using strafing animations in your blendspace, but your video shows your logic is not set up for strafing. You are currently allowing only standard locomotion, which means the character is turning toward the velocity direction; that is, the character will always be running forward toward the velocity direction. Try toggling the UseControllerRotationYaw on and off to see what happens.

I’m already toggling the UseControllerRotationYaw on and off and even with disabled root option my character can only move forward.

UPD. OMG, you’re genious! There were two things, I should do to fix my problem:
disable root motion on every animation;
set requered speed in blendspace, so my character can achive requered state


He couldn’t achive that because I didn’t have a logic of walk yet. I have only run.
Please, tell me where I can learn about it more? Something like why I should’n use root motion in blendspace, how to PROPERLY create movement system. I found a lot videos on youtube, but most of them showing a… strange… things, like casting every frame and other.

I guess I missed that in your logic. I’m glad you figured it out!

As for resources, there are a lot, but good ones are difficult to find. A simple explanation between in-place and root-motion animations can be found in this video. But you’ll probably need to watch a few videos and read a few articles before you are comfortable with the differences.

There are pros and cons to both types of animation systems. In my game, I’m developing a data-driven (in-place) system because responsiveness is easier to achieve with an in-place setup than with a root-motion setup.

Thank you very much for your help!