Create an animation instance inside the tool, go to properties tab and put the AnimationId property as: “rbxassetid://YOUR_ANIM_ID_HERE”. also name it as Swing anim or something like that.
Is an animation instance the thing that you get from the objects menu just called “Animation”
Yes, that is what he is referring to.
Add an Animation instance to the tool, click the plus sign on the tool and search “Animation”.
then go to the properties tab of the animation and put the anim ID as your anim id. Also remember to change the “ANIMATION_NAME” on the script to the animation instance’s name.
Ok thanks ill test it soon, and let you know if it was the solution.
ok its working but it looks like it wants to play the animation and starts playing but hesitates, also when you unequip and equip the tool as you can see in the video it takes a bit for the tool to actually disappear, how do I fix it?
robloxapp-20221116-1222061.wmv (1.1 MB)
It seems like the animation is getting overriden by other animations, seems like i forgot to put the track.Priority property. (edited the code for the 14124812938th time)
found another mistake, oh god im so terrible at coding, also how long is your animation? is it .25 miliseconds? else thats probably the reason its stopping so fast
ok thank you, lol its ok, at least you know how to code, i just remember what it says and type it. lmao
its ok, you got this (Character limit)
Calling :LoadAnimation
every time you click it’s not what you want for your memory! Instead check if the animation is playing with the IsPlaying
property if the animation isn’t playing than play the animation if IsPlaying
is false.
thanks, i dont really know about memory leaks
is it suppost to be a local script??
nope lol, its basically bad coding practice (when your script has memory leaks a lot then your code is not gud) you can search more about it
ok is it good now though? lol (Character limit)
nah its not working now lmao, the animation isnt happening
done, check the script again lol this is like my first time being able to post and reply on devforum (also im not good at animating or animation scripts, so my method might be inefficient)
ok that’s fair, I remember my first time i had to wait ages lol, ill take a look
You dont really need to do all those string value things. If you want animations just do this.
local anim = Instance.new("Animation")
anim.Name = "" --Name
anim.AnimationId = "rbxassetid://ANIM" --replace "ANIM" with your animation ID
--[[
local parent =
local hum = Here should be variables that get the parent and the humanoid of the character holding the tool
]]
hum:LoadAnimation(anim):Play()
Or if you want multiple animations:
local anim1 = true
local anim2 = false
local anim = Instance.new("Animation")
anim.Name = "" --Name
anim.AnimationId = "rbxassetid://ANIM" --replace "ANIM" with your animation ID
local anim2 = Instance.new("Animation")
anim2.Name = "" --Name
anim2.AnimationId = "rbxassetid://ANIM" --replace "ANIM" with your animation ID
--[[
local parent =
local hum = Here should be variables that get the parent and the humanoid of the character holding the tool
]]
if anim1 then
anim2 = true
anim1 = false
hum:LoadAnimation(anim):Play()
elseif anim2 then
anim1 = true
anim2 = false
hum:LoadAnimation(anim2):Play()
end
(Note: I made this without testing in studio. There might be some typos.)
ok its working now but i have to figure out somthing else gimme a sec