How to make ANIMATIONS for a TOOL in ROBLOX STUDIO!
ฝัง
- เผยแพร่เมื่อ 4 ต.ค. 2024
- How to make an Idle and Walk animation for a Tool in Roblox Studio
This is a tutorial about making animations for tools in Roblox Studio. Make sure to subscribe, leave a like and comment!
Thanks so much for watching!
roblox particle,roblox tutorials,lighting tutorials,roblox studio,roblox plugin,roblox anime vfx,modeling tutorials,building tutorials,lighting,particles,particle tutorials,particle emitter,lights,modeling,building,roblox vfx,vfx tutorials,light,roblox,studio,tutorials,gaming,builds,models,blender,tutorial,build,games,model,plugins,help,game - เกม
I forgot to add, if you want the animation to stop playing when you jump, just add a line into the while loop in the server script “if humanoid.Jump == true then” and then stop the idle animation and the walk animation.
can you open source it?
it didnt work
@@cool_blox3877bro just make your own tool and do it i did it and it worked and it was fun
which line?
bro i love u, i would kiss you if i could ty ty
Script:
script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local equipped = true
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script.Walk)
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if equipped == false then return end
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking == false then
walking = true
idle = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
equipped = false
end)
end)
Also thanks for the tutorial it helped a lot
PIN THIS MAN!
Thanks btw I know im late but do you know how to fix the bug where the walk animation plays after you unequip the tool?
finnaly, you saved my life (time)
@@Spacemanjamie go to the Unequipped Part and write " script.Parent.Unequipped:Once(function()
walkanim:Stop()
idleanim:Stop()
equipped = false
end)
end)" and when the player enequip the tool the walk anim will stop.
OMG thank you so much i was asking for that and now you made a guide , thx keep going your going to help alot of roblox devs and maybe some decent game will come out with your help.
Part 2 SPRINTING!!!!!!!!! Come back you are the best!! Continue being so helpful!!!!!🎉
You have to use userinput to check if the player is holding down/clicked the shift key to raise the speed and change the animation
@@Enigmatic-v83 I already did it
I have been looking for a video like this thanks so much you help me alot
No problem!
I've been trying to add an animation to a stupid tool for about 3hrs, this saved me, ty
to anyone having trouble with the animation still playing after unequipped:
i revised it, this script should work
local tool = script.Parent
local equipped = false
local idleanim, walkanim
tool.Equipped:Connect(function()
local char = tool.Parent
local humanoid = char:FindFirstChild("Humanoid")
equipped = true
idleanim = humanoid:LoadAnimation(script.CoffeeIdle)
idleanim:Play()
walkanim = humanoid:LoadAnimation(script.CoffeeWalk)
local idle = true
local walking = false
while equipped do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
if not walking then
walking = true
walkanim:Play()
end
else
if walking then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
end
wait(0.1)
end
end)
tool.Unequipped:Connect(function()
if equipped then
idleanim:Stop()
walkanim:Stop()
equipped = false
end
end)
Thanks
"i am just now making a katana tool"
the toolbox suspiciously open on the left:
Thanks :0
Also the tool grip editor thing is rlly handy tysm :D
It works if I change the while loop for a property changed signal (hum)?
Just in time!,
I'm trying to make an intermediate sword, would you mind making a video on that next?
All other videos that show how to make swords are basic simple ones with one animation and no blocking, so i was wondering if you could take my video request?
It's okay if not :))
Can you help me The animation work properly but after around 1 second the default walk animation kicks in
THANK YOU
THANK YOU SNAKE ROBBS!!
my animations only work in roblox studio do you know the reason for it and if you do please tell me how to fix it
super underrated, can you make a beam tutorial??
Thanks.
i had this running in the background while i was making the walk anim lol
edit: got near the end but the walk anim aint playing, and i dont see any errors in the script + when i got to when it worked "fab" IDLE WASNT WORKING
edit2: thx to @exyft for comenting the code i was gonna go thou pain doing what the vid did
How do you switch modes when animating? Like rotate to move?
r or z it depends on a keyboard for me its r
Nice vid
can you make a slash animation for this too? like on click?
i got no error but its not playing thr animation can anyone help?
What happen with my idle animation? its doesn't work perfectly its like something stuck!
i want to let you know that if you keep doing this you will get to 100k some day
Haha not sure about that but i hope so!
someone know how can i animate tools parts? *motor6d*
How do i make this but for a flashlight? I did everything correctly but its not working
im using a action animation btw
How do i make it not affect the action
Hey, it isn't working for me.
Here's the script:
script.Parent.Equipped:Connect(function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script.WalkAnim)
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking then
walking = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end)
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
Bud, It should NOT be that long. It should look like this.
script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
local walkanim = humanoid:LoadAnimation(script.Walk)
walkanim:Play()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
@@DivinedustWarrior That also doesn't work. I think it is blending with the normal walk animation and it not reverting the the normal walk animation, however I do not know how to fix that.
@@duckyee_ wasnt working for me too i fixed it if u are using the walk animation thingy with r6 bundle make sure ur avatar and game is set on r6 too or else it wont work or u can make another r15 animation
everything works but the walking animation is weird(only one leg works) the animation is on the option movement i tried everything but it still doesnt work
its r15
same
maybe you can try putting below the load anim one "(youranimname).Priority = Enum.AnimationPriority.Action"
for some reason im not getting any errors but the walk animation doesnt work
try this:
script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
local walkanim = humanoid:LoadAnimation(script.Walk)
walkanim:Play()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
Im still having the walk anim play after unequipping the tool. I copied everything, even the end where you fix the bug, but it didnt work for me
NVM LOL, FIXED IT!!! TYSM BTW
how do u fix it@@fairieiz
@@fairieiz how did you fix it?
howd you fix it?
How do i play a sprinting animation when the player holds shift or walkspeed is > 12?
i will make a sprint video next!
@@SnakesRobbs WHERE IS IT GOOD SIR
It's doesn't work, why?😢
Ok
i can have the script please thanks .
script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
local walkanim = humanoid:LoadAnimation(script.Walk)
walkanim:Play()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
bro is the number 1 elseif hater
tool grip editor plugin costs 100 robux :/
its free
not anymore@@MrANONYMOU8
hi
Hey!
Heres the script! (Pin this pls)
script.Parent.Equipped:Connect(function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script.WalkAnim)
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking then
walking = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end)
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
Ty
does it work
@@AngpaoRealz.
He did not pin it
i tried but run animation don't works
can you send your code?
@@SnakesRobbs mine doesnt work too, i can send my code:
script.Parent.Equipped:Connect(function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local equipped = true
local idleanim = humanoid:LoadAnimation(script:WaitForChild("idle"))
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script:WaitForChild("Walk"))
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if equipped == false then return end
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking then
walking = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end)
script.Parent.Unequipped:Once(function()
idleanim:Stop()
equipped = false
end)
end)
fixed.
Help Pls it wont work for me
Can you send your script?
it did not work here is my script
script.Parent.Equipped:Connect(function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script.WalkAnim)
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking then
walking = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end)
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
You didnt put () at the end of your coroutine function, so it will not run. It is a function, and you need to start a function for it to work
@@SnakesRobbs thx
But they did put () at the end of the function??@@SnakesRobbs
did everything the same doesnt work
Can you send me your script?
script.Parent.Equipped:Connect(function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local equipped = true
local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script.WalkAnim)
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if equipped == false then return end
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking then
walking = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end)
script.Parent.Unequipped:Once(function()
idleanim:Stop()
equipped = false
end)
end)
if this script didnt work, notify me
@@parasiter5 so i checked for errors and there were none, yet the animation didn't play and yes it did have its animation made by me its just isn't playing everything, it was named right in the workplace so its really just the code.
how do u make it so it doesnt stop playing and it always plays on mobile
Remove the :stop()s
it doesnt work for me
my script:
script.Parent.Equipped:Connect(function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local equipped = true
local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script.WalkAnim)
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if equipped == false then return end
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking then
walking = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end)
script.Parent.Unequipped:Once(function()
idleanim:Stop()
equipped = false
end)
end)
try this:
script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
local walkanim = humanoid:LoadAnimation(script.Walk)
walkanim:Play()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
Super confusing, and hard to follow because you keep moving and deleting scripts so nothing was in order
Edit: It's Working now, i just fixed it. Heres what it should look like. BTW, why is yalls scripts so long? it should look like this:
script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
local walkanim = humanoid:LoadAnimation(script.Walk)
walkanim:Play()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
You're Welcome (:
What’s the priority of the animations have to be
What’s the priority of the animations have to be
I tried your version its broken
hi there, the script doesnt want to work correctly
im actually trying to make the walk anim play but it doesnt play and when i unequip it the idle keeps playing :(
script.Parent.Equipped:Connect(function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
idleanim.Priority = Enum.AnimationPriority.Action
idleanim:Play()
local walkanim = humanoid:LoadAnimation(script.WalkAnim)
walkanim.Priority = Enum.AnimationPriority.Action
local idle = true
local walking = false
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
idle = false
coroutine.wrap(function()
if walking then
walking = true
walkanim:Play()
end
end) ()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
walking = false
idle = true
idleanim:Play()
end
else
walkanim:Stop()
walking = false
if idle == false then
idle = true
idleanim:Play()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
How do I make it that when I walk the sword idle and walk animation stops? I can't figure it out
you can put "walkanim:Stop()" at the end with the idle stop anim line when you unequip. Hope this helps
i tryed it but the idle animation deosnt work for me
Same it says "failed to load the ID"
script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
local walkanim = humanoid:LoadAnimation(script.Walk)
walkanim:Play()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end). youre welcome (:
@@Vanchester_Sec1 try this: script.Parent.Equipped:Connect (function()
local char = script.Parent.Parent
local humanoid = char:FindFirstChild("Humanoid")
local idleanim = humanoid:LoadAnimation(script.Idle)
idleanim:Play()
coroutine.wrap(function()
while wait() do
if humanoid.MoveDirection.Magnitude ~= 0 then
print("Walking")
idleanim:Stop()
local walkanim = humanoid:LoadAnimation(script.Walk)
walkanim:Play()
if humanoid.MoveDirection.Magnitude == 0 then
walkanim:Stop()
end
end
end
end) ()
script.Parent.Unequipped:Once(function()
idleanim:Stop()
end)
end)
Thx