You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want to achieve that if you press the key C your avatar starts crouching and when your character is not moving the animation stops.
What is the issue? Include screenshots / videos if possible!
Nothing works. The strange thing is that the messages get printed but the animation doesn’t plays.
Here is a Video of how it should look like:
(literally my first animation)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried debugging and made sure that i published the animation
Here is the Script:
local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local Humanoid = player.Character:FindFirstChild('Humanoid')
local Animation = Instance.new("Animation", player.Character)
Animation.AnimationId = "rbxassetid://10031055282"
local Animate = Humanoid:LoadAnimation(Animation)
UserInputService.InputBegan:Connect(function(Key)
if Key.KeyCode == Enum.KeyCode.C then
print("running")
Animate:Play()
end
end)
UserInputService.InputEnded:Connect(function(Key)
if Key.KeyCode == Enum.KeyCode.C then
print("stopped")
Animate:Stop()
end
end)
player.Character:WaitForChild("Humanoid").Running:Connect(function(speed)
if speed > 0 then
Animate:AdjustSpeed(1)
else
Animate:AdjustSpeed(0)
end
end)
I edited the Script so that it works now. I think the problem was that I made the function Animation:Play() instead of Animate:Play()… what was your problem back then? Oh, also I have a question, Ive remade the Animation and it looks like this now:
But in Game the Animation looks kind of broken…
(it just doesnt looks like the made animation…)
ok i made the animation in moonanimator and now i solved the problem but there are 1 other problem now: 1. when i press c the animation only plays 1 time…