#Coding animations to not have start tweening
1 messages · Page 1 of 1 (latest)
Code?
Boii 💀💀
And another thing, when you are checking the air value if it is false, you can do: if not
Because doing == false is redundant and it's always recommened to use not instead of ==.
ye ik
And also another problem, you do not add variables, you keep doing script.Parent.
the only problem is the tweening of the animations and idk why it happends
Could you send it in chat please?
wdym by send it in chat
The code.
local animator = script.Parent:WaitForChild("Humanoid"):WaitForChild("Animator")
local fall = animator:LoadAnimation(script:WaitForChild("Fall"))
local walk = animator:LoadAnimation(script:WaitForChild("Walk"))
local idle = animator:LoadAnimation(script:WaitForChild("Idle"))
game["Run Service"].RenderStepped:Connect(function()
if script.Parent:FindFirstChild("HumanoidRootPart") then
local still = false
if script.Parent:FindFirstChild("HumanoidRootPart"):FindFirstChildWhichIsA("BodyVelocity").Velocity.Magnitude < 1 then
still = true
end
if script.Parent.movement.AIR.Value then
if walk.IsPlaying then
walk:Stop()
end
if idle.IsPlaying then
idle:Stop()
end
if fall.IsPlaying then
else
fall:Play()
end
end
if script.Parent.movement.AIR.Value == false then
if fall.IsPlaying then
fall:Stop()
else
end
if still then
if walk.IsPlaying then
walk:Stop()
end
if idle.IsPlaying then
else
idle:Play()
end
else
if idle.IsPlaying then
idle:Stop()
end
if walk.IsPlaying then
else
walk:Play()
end
end
end
end
end)
Hmm...
if script.Parent.movement.AIR.Value then
if walk.IsPlaying then
walk:Stop()
end
if idle.IsPlaying then
idle:Stop()
end
if fall.IsPlaying then
else
fall:Play()
end
end
if script.Parent.movement.AIR.Value == false then
if fall.IsPlaying then
fall:Stop()
else
end
if still then
if walk.IsPlaying then
walk:Stop()
end
if idle.IsPlaying then
else
idle:Play()
end
else
if idle.IsPlaying then
idle:Stop()
end
if walk.IsPlaying then
else
walk:Play()
end
end
I believe this is the core issue.
When you are checking the air value if it's false, you need to add a not
** You are now Level 12! **
That should be the fix.
Let me give me some advice, nesting can make your code unreadable for other developers to read.
And always make variables please.
the problem isnt the code, its the animations not being instant
I know.
Wait, have you ever tried using HumanoidStateChanged before?
yse
Why don't not use that?
imma try it