Hi epic and crew, I’m not sure if I’m wording that in a way that makes sense, but the issue I’m having is I’m making a blendspace for normal movement. It entails a, idle. run forward, and strafe left/right animation. The problem I’m having is that when strafing, our animation includes a head turn, however the turn tracks in world direction, which makes sense because i’m taking the players velocity, and breaking out the x component to get the strafe, but what I’m not sure on, is what i need to do to get a relative direction to…something? Camera direction? this is what I’m unsure on, any help is, as always appreciated!
Sorry for not being completely clear Rimmy, let me try to describe the problem another way.
Let’s say I’ve got a room with each wall on a cardinal direction, with north, directly a head of me when the map loads, at what would in normal math, be 90 degrees (I’m not positive if that’s how the engine sees it, but I want to define that so it makes sense and we’re all on common ground), west is to my left, at 180, and east is to my right, at 0 degrees. I can run towards the north and south walls all day, with no problem, and if i strafe towards the east, or west, while still facing north, I also have no issue. However, if I start running towards the north, and turn to the west as I’m turning my head will look that direction (intended), however, once I’ve obtained a straight line vector again,the characters head remains looking to their left.
So instead of a world “angle” of 90 degrees always being forward, I need some way to determine that the character is moving in a straight line. does that make more sense?
Heya, just a little confused and totally correct me if i am wrong. Are you asking how to determine the rotation values for the head to face forward while the character is running/strafing to the side?
I would handle this by taking the player’s movement direction versus his facing direction.
This may come down to exactly how you are doing your movement. Are you rotating the entire pawn to face to the direction of movement or does the pawn stay facing “forward” while his movement is actually sideways to his facing direction?
In a typical shooter third person setup i would have the forward for the pawn be the camera direction and blend strafe anims as his direction of movement strays from his facing direction (which mostly matches the camera). At this point you aren’t concerned for his world orientation exactly.
If i remember correctly the ShooterGame example uses an anim blueprint with this sort of system in mind. They blend through a BlendSpace using these values. 0 is front, 90 is right, 180 is back, and 270 is left. (I THINK that’s how theirs works, either way it should be useful to check out).
This has gone a little long so let me know if it was helpful at all