I have a problem with my first person character.
I have a 2D Blendspace you’ll see below.
The main problem is, that the direction won’t set correctly if my character is moving. If I stand still, the direction value goes up to 180 and down to -180.
When I start walking now and change my direction at the same time the direction value can just go up to 15 and down to -15.
Another problem is, that when I walk backwards the direction “stuck” at 175 and -175.
You can see my Animation Blueprint too.
All those blie lines you can see are coming out of the “Try Get Pawn Owner” function.
Sorry for my Blueprints - I know they are a mess I’m just learning
instead of using speed and angle as the 2d axes for your blendspace Id use vector magnitude (as I call it).
So You have vector x which is generally forwards and backwards and vector y which is left and rig.
Then you can set up a circular pattern instead of a rectangular one. The axes then go from -maxSpeed to +maxSpeed in x and y.
Here what I do is to have a float speedMode variable that dictates the character maxWalkSpeed, acceleration, brakingFrictionFactor, etc. 0 is standing still, 1 is walking, 2 is running, 3 is sprinting.
So then I have to get the relative direction of the velocity against the actor using the dotProduct of the velocity vector vs the actor forward and actor right vectors. That then I multiply by my speedMode variable and feed it into the blendspace I have set up with those x and y axis.
This has a few advantages:
the ability to scale as you need by just adding circular rings of anim pins if needed. A speed/angle approach also offers this, but you have duplicate pins at 180 and -180.
no interpolation issue when going from diagonal backwards left to diagonal backwards right. Depending on how you set up your variable that could basically make your angle go from -165 or whatever to 165 over 0 instead of over -180 and flip. That basically gives you a full circle while you just changed a few degrees crossing -180/180.
edit, just noticed the video link there, sec watching…
alright…
cant quite tell whats going on… in your video, at 0:13, it looks like that setup with the dotproducts is a bit wired, can you post a big screenshot of it?