Locomotion Movement Animations?

So just got done making my forward walking animation and my backward walking animation, but then I realized I wanted to have the legs rotate/face towards -45, 45, -135 and 135

Making animations for each of them would be too tedious and i realized that halfway through making the -45 animation.

So how would I go about doing this? I was thinking manipulating the C0 of the Hips and getting the angle depending on which combination of keys I press

really depends on how good of a programmer you are. theres a pretty popular algorithm called inverse kinematics which is what makes vr players feet move all weird when they walk. however if youre not willing to go that far, you could try and rotate the lower torso to face the direction the player is moving (with limits on the rotation) and adapt your animations accordingly.

Well I am on am using an R6 Character and I was thinking of just rotating the Hips Motor6Ds and just rotating them depending on which combination of keys I press, which is not really procedural I think I got confused

yeah that should yield the same effect. its more procedural than manually coding in directional animations. if you want true procedural you should look into Inverse Kinematics

1 Like

Wow okay thank you for the clarification I didnt fully understand what procedural meant, Ill try your idea and get back to you

1 Like

procedural kinda means automatic/automated. ie instead of manually making a map you write code that does it procedurally meaning the terrain is generated without you having to place anything. with animations it means you dont have to animate anything, the code will move things accordingly.

1 Like

Ohhh okay so technically I am making prodcedurally animations by rotating the Motor6Ds in a moment, thanks for the explanation!

1 Like

Got it too work man thanks so much!
@HeartBeatStoppah

My Code

if UIS:IsKeyDown(Enum.KeyCode.W) and UIS:IsKeyDown(Enum.KeyCode.D) then
		left_hip.C0 = CFrame.new(left_hip.C0.Position) * CFrame.Angles(0,math.rad(180),0) * CFrame.Angles(0,math.rad(45),0)
		right_hip.C0 = CFrame.new(right_hip.C0.Position) * CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(0,math.rad(-45),0)
		--print("Forward Right")
	elseif UIS:IsKeyDown(Enum.KeyCode.W) and UIS:IsKeyDown(Enum.KeyCode.A) then
		--print("Forward Left")
		left_hip.C0 = CFrame.new(left_hip.C0.Position) * CFrame.Angles(0,math.rad(-45),0)
		right_hip.C0 = CFrame.new(right_hip.C0.Position) * CFrame.Angles(0,math.rad(90),0) * CFrame.Angles(0,math.rad(45),0)
end
2 Likes