I’m currently working on a custom animator for characters. When the player taps a movement key over and over the move animation snaps (id like it to be more smooth, maybe continue?), like so:
RunService:BindToRenderStep("character_animations", 999, function(deltaTime: number)
local currentState: Enum.HumanoidStateType = self.Humanoid:GetState()
if currentState == Enum.HumanoidStateType.Running then
if self.States.Moving then
if range(self._stored.speed, 8 * 2.1, 1) then
self:_Play("walk", "Run", true, 0.35)
elseif range(self._stored.speed, 8, 1) then
self:_Play("walk", "Move", true, 0.35, 0.65)
end
else
self:_Play(self.States.Position, "Idle", true, 0.4)
end
end
end)
function animator:_Play(pose: string, animationName: string, override: boolean, fadeSpeed: number?, modSpeed: number?)
if override then
for animName: string, state: boolean in pairs(self.PlayingAnimations) do
if state and pose .. animationName ~= animName then
self.LoadedAnimations[animName]:Stop(fadeSpeed)
end
end
end
local name: string = pose .. animationName
if self.PlayingAnimations[name] then
return
end
self.PlayingAnimations[name] = true
local anim: AnimationTrack = self.LoadedAnimations[name]
anim:Play(fadeSpeed)
anim:AdjustSpeed(Utility.GetSpeedMult(self.Character.Move.Speed.Multipliers) + (modSpeed or 0))
anim.Stopped:Once(function()
self.PlayingAnimations[name] = false
end)
return anim
end
If anyone has a possible solution to this, please share your thoughts, thanks a bunch.