I’ve been trying to implement a custom “run” animation using robloxs custom animation script. Everything works well until I change the walkspeed to a certain number where the “weights” of the animations seem to collide with each other making it look very weird?
Gif: https://gyazo.com/c15061ac357c0fe5f55e9370775243ad
Normal WalkSpeed: 16, bugs at 9 walkspeed and returns to normal at around 7
I have mainly just messed with this part of the Animation script to fix it but haven’t been able to find a solution
local function setRunSpeed(speed)
local normalizedWalkSpeed = 0.5 -- established empirically using current `913402848` walk animation
local normalizedRunSpeed = 1
local runSpeed = rootMotionCompensation(speed)
local walkAnimationWeight = smallButNotZero
local runAnimationWeight = smallButNotZero
local walkAnimationTimewarp = runSpeed/normalizedWalkSpeed
local runAnimationTimerwarp = runSpeed/normalizedRunSpeed
if runSpeed <= normalizedWalkSpeed then
walkAnimationWeight = 1
elseif runSpeed < normalizedRunSpeed then
local fadeInRun = (runSpeed - normalizedWalkSpeed)/(normalizedRunSpeed - normalizedWalkSpeed)
walkAnimationWeight = 1 - fadeInRun
runAnimationWeight = fadeInRun
walkAnimationTimewarp = 1
runAnimationTimerwarp = 1
else
runAnimationWeight = 1
end
currentAnimTrack:AdjustWeight(walkAnimationWeight)
runAnimTrack:AdjustWeight(runAnimationWeight)
currentAnimTrack:AdjustSpeed(walkAnimationTimewarp)
runAnimTrack:AdjustSpeed(runAnimationTimerwarp)
end
Any Ideas?