My new custom character refuses to change its direction midair. However, my old character actually does not have this problem. My older character and new one have the same humanoid properties and sizes. I guess the issue not related to the hair accessary since I tested it, so I don’t know why this happens, it would be really nice if someone will navigate me to the source of this issue.
Here’s the script, but I don’t think this problem is related to it too
local runS = game:GetService("RunService")
local anim = script:WaitForChild("Walk")
local idle = script:WaitForChild("Idle")
local jump = script:WaitForChild("Jump")
local fall = script:WaitForChild("Fall")
local character = script.Parent
local hum = character:WaitForChild("Humanoid")
local animTrack = hum.Animator:LoadAnimation(anim)
local animTrack2 = hum.Animator:LoadAnimation(idle)
local animTrack3 = hum.Animator:LoadAnimation(jump)
local animTrack4 = hum.Animator:LoadAnimation(fall)
animTrack2:Play()
local HRP = script.Parent:WaitForChild("HumanoidRootPart")
local interval = .1
local elapsed = 0
runS.Heartbeat:Connect(function(dT)
elapsed += dT
if elapsed >= interval then
elapsed -= interval
local magY = math.abs(Vector3.new(0, HRP.AssemblyLinearVelocity.Y, 0).Magnitude)
local magX = math.abs(Vector3.new(HRP.AssemblyLinearVelocity.X, 0, 0).Magnitude)
local magZ = math.abs(Vector3.new(0, 0, HRP.AssemblyLinearVelocity.Z).Magnitude)
if magX > 0.3 or magY > 0.3 or magZ > 0.3 then
if not animTrack.IsPlaying then
animTrack:Play()
end
animTrack2:Stop()
else
animTrack2:Play()
animTrack:Stop()
animTrack3:Stop()
print("no")
end
end
end)
hum.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Jumping then
animTrack3:Play()
animTrack:Stop()
animTrack2:Stop()
elseif new == Enum.HumanoidStateType.Landed then
animTrack3:Stop()
end
end)
