-
What do you want to achieve? Keep it simple and clear!
I want to make a swimming animation. -
What is the issue? Include screenshots / videos if possible!
The animation doesn’t play and instead playing a jumping animation. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve looked for hours and cannot find a solution that works. (The animation is on the group!)
wait(5)
local plr = game.Players.LocalPlayer
local char = plr.Character
local swim = script.Parent.Animations.R15:FindFirstChild("Swim")
local swimidle = script.Parent.Animations.R15:FindFirstChild("SwimIdle")
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input)
local hum = char.Humanoid
local animator = hum.Animator
if input.KeyCode == Enum.KeyCode.W or input.KeyCode == Enum.KeyCode.S or input.KeyCode == Enum.KeyCode.Space or input.KeyCode == Enum.KeyCode.A or input.KeyCode == Enum.KeyCode.D and hum:GetStateEnabled(Enum.HumanoidStateType.Swimming) then
print("swimming")
local a1 = hum:LoadAnimation(swim)
a1:Play()
else
print("idle")
local a2 = hum:LoadAnimation(swimidle)
a2:Play()
end
end)
(every other animation works fine, just the swimming.)