Hello, I’m new to animating on Roblox and I’m pretty trash at it. I’ve created this simple hold animation for one of my weapons in my game. When I try it out in my game, yes it does play the animation. But it just ends like right after, how can I get the animation to stay there? This is my simple animation script and a video. However I don’t think the script is the problem.
LocalScript inside Tool
local id = "5610784952" script.Parent.Equipped:Connect(function() game.ReplicatedStorage.Events.GunAnimate:FireServer(id) end) script.Parent.Unequipped:Connect(function() game.ReplicatedStorage.Events.StopGunAnimate:FireServer(id) end)
ServerScript in ServerScriptService
local events = game.ReplicatedStorage.Events events.GunAnimate.OnServerEvent:Connect(function(player, animationId) local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID="..animationId local loadAnimation = game.Workspace[player.Name].Humanoid:LoadAnimation(animation) loadAnimation:Play() events.StopGunAnimate.OnServerEvent:Connect(function() animation:Destroy() end) end)
And here’s a video:
Also how would I stop the gun from being sideways? Sorry I’m a noob at this