Heyo,
The walking animations in my game are different from default Roblox’s. There are animations for walking backwards, sprinting, and walking forwards (replaces the default run animation).
To achieve this, I adjusted the animation script inside the avatar. The only part i modified so far was the onRunning function (found in the state change handlers), shown below:
function onRunning(speed)
local movedDuringEmote =
userEmoteToRunThresholdChange and currentlyPlayingEmote and Humanoid.MoveDirection == Vector3.new(0, 0, 0)
local speedThreshold = movedDuringEmote and Humanoid.WalkSpeed or 0.75
if speed > speedThreshold then
if speed < 20 then
local scale = 16.0
if Humanoid.MoveDirection.X > 0 then
if Character.HumanoidRootPart.CFrame.LookVector.X > 0 then
playAnimation("walk", 0.2, Humanoid)
pose = "Running"
else
playAnimation("walk", 0.2, Humanoid)
pose = "BackWalk"
end
else
if Character.HumanoidRootPart.CFrame.LookVector.X > 0 then
playAnimation("walk", 0.2, Humanoid)
pose = "BackWalk"
else
playAnimation("walk", 0.2, Humanoid)
pose = "Running"
end
end
else
local scale = 16.0
playAnimation("walk", 0.2, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Sprinting"
end
else
if emoteNames[currentAnim] == nil and not currentlyPlayingEmote then
playAnimation("idle", 0.2, Humanoid)
pose = "Standing"
end
end
end
The Issue
For some reason, when the animations for walking backwards/sprinting plays, it jitters into the forward walking animation.
I assumed it was because the priority for the forward walking animation was too high, so I set it to Core, but it still happened.
Here’s what it looks like (the sprinting animation is a placeholder):
What can I do to get rid of this? Alternative approaches would help too.