All the actual movement is done in the ProceduralAnimation class which creates the goal target for the inverse kinematics as @Vran_n is within the video.
Bounce CFrame makes it go up and down.
And the sway controls the rotation side to side, it’s been set to some arbitrary value try playing around with it or removing it entirely.
Modifying the WastCycle will mainly change the timing of when the bounce happens, such as it bounces up when the leg is being raised up.
function ProceduralAnimatorClass:MoveTorso(stepCycle,dt10,rootVelocity)
local bounceCFrame = CFrame.new(0,self.WalkBounce*math.cos((self.WaistCycle+90+45)*2),0)
local sway = math.rad(-relv1.X)+0.08*math.cos(self.WaistCycle+90)
local swayY = 0.1*math.cos(self.WaistCycle)-2*math.rad(relv1.X)
local swayX = math.rad(relv1.Z)*0.5*self.SwayX
local goalCF = bounceCFrame*waist1*ANGLES(swayX,swayY,sway):inverse()
For @Vran_n sorry for the lack of reply, the legs being funky and not reaching the goal in a nice manner has to do with the inverse kinematics method, it’s iterative and doesn’t generate a 100% solution towards the goal it guesses and tries and doesn’t care if it looks weird or not TL;DR. This is known as an Analytical solution. This is also the reason why it is not compatible with Animations.
You could also reset the C0 of the limbs once in a while in order to make the CCDIK start from the baseline position and reset the rotations locking it in a “weird place”.
Where I learnt the IK method
These concavities are impossible to avoid in a heuristic IK algorithm (read: all of them except
Analytic
). However, it is possible to “jump out of” concavities by adding large random offsets to each joint, and then attempting the IK solve again. This is known as “Simulated Annealing”. Implementing this is left as an exercise to the reader.
You can try replacing it with the classic 2 joint and 2 limb inverse kinematics as the code artifically creates an additional limb for R6 to make the R6 pretend it has a knee to raise “Up”.
the code for this is a one liner
function ProceduralAnimatorClass:MoveLegs(stepCycle,dt)
--Current IK method used
Leg.CCDIKController:CCDIKIterateUntil(footPos,IKTolerance)