ocal function playAnimationFromServer(character, animation)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
-- need to use animation object for server access
local animator = humanoid:FindFirstChildOfClass("Animator")
if animator then
local animationTrack = animator:LoadAnimation(animation)
animationTrack:Play()
return animationTrack
end
end
end
“need to use animation object for server access” Animation object? I’m sorry if this answer is really obvious its really late and this is new stuff and i’ve been looking for a clue for multiple hours.
dont go instantly to rescripting your stuff :LoadAnimation() still works there are just better alternatives at the moment
Try checking if the Animation has an Id
after a bit of testing i think :LoadAnimation() doesnt work anymore i dont know why
But try looking at the Animator class
i havent had to work with animators so im just as in the dark as you
Edit: For some reason now its working no changes just started working
Tool.Equipped:Connect(function()
local Human = Tool.Parent:FindFirstChildWhichIsA("Humanoid")
if not Human then
Human = Tool.Parent:WaitForChild("Humanoid")
else
local AnimationTrack = Human:LoadAnimation(Animation)
AnimationTrank:Play()
end
end)
It seems to me like you’re animating a gun rig, but never attaching it to the character at run-time… I’m pretty sure you need to attach BodyAttach to your character somehow, I don’t know how your rig is meant to be used, but you definitely need to do this, also - since you’re using a tool, you need to remove the RightGrip weld in the character’s RightHand!!
is there any errors? also it may be because your using the activated function, not the equipped function, activated is fired when you click while holding the tool and equipped is fired when you equip the tool
Any animation using conventional tools will be over ridden. To add on load animation is deprecated and should use the new animator instead. To add on to that you want to be using the body attach method in which you use motor 6ds to attach the gun to the player instead of using conventional animations in which you would see in older roblox games. How to animate Tool Parts (Guns, Knifes etc.)