How to MAKE Animations Play When A Part Gets Touched.. (Roblox Studio)

Поділитися
Вставка
  • Опубліковано 28 вер 2024
  • 🛠Thanks so much for watching, hope you guys have a great day! Subscribe 😎🛠
    Animation Tutorial: • The ULTIMATE Beginner'...
    😎Subscribe: www.youtube.co...
    💬Discord: / discord
    🌴Roblox Group: www.roblox.com...
    👑Rusty Merch: www.roblox.com...
    ⌚Timed Chapters:
    📝Tags:
    #roblox #robloxstudio #lua #robloxstudiotutorial #tutorial #howto #robloxanimation
    ❓What is Roblox Studio?
    🔎Roblox Studio lets you create anything and release with one click to smartphones, tablets, desktops, consoles, and virtual reality devices.
    ❓Who am I?
    🔎I am a Roblox Studio, and Blender, Tutorial UA-camr that you should Subscribe to :)

КОМЕНТАРІ • 632

  • @rustysillyband
    @rustysillyband  Рік тому +588

    local anim = script.Animation
    local humanoid = script.Parent.Humanoid
    local animTrack = humanoid:LoadAnimation(anim)
    local debounce = nil
    game.Workspace.Part.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player and debounce == nil then
    debounce = true
    animTrack:Play()
    wait(1) -- Change this to however much time you want to wait until the animation can play again.
    debounce = nil
    end
    end)

    • @madnessWG
      @madnessWG Рік тому +20

      OH HOLY RUSTY I HAVE BEEN SEARCHING FOR 3 DAYS IN A ROW FINDING THIS BELOVED SCRIPT TO MAKE A ROBLOX GAME! THANK YOU GENTLEMEN

    • @madnessWG
      @madnessWG Рік тому +7

      Oh holy rusty of the god please make a r6 version. To make my zombie game! So I can finally rest of holy God named rusty please read this comment and heart it so your presence Is known!

    • @MarxismOfficial
      @MarxismOfficial Рік тому +4

      thx

    • @126sxch
      @126sxch Рік тому +2

      Oooookooiiiiiio

    • @Rebbeca.morgan1381
      @Rebbeca.morgan1381 Рік тому +2

      @@126sxch oOoOooOoOooOoOooOoOoOooO

  • @LunarLaughs107
    @LunarLaughs107 3 місяці тому +305

    Player: *touches random part*
    Rig: *has a seizure*

  • @Tackiejuice
    @Tackiejuice Рік тому +29

    Tip for beginners it looks better if the block is invisible

    • @mikeartsyt89_2
      @mikeartsyt89_2 Рік тому +5

      then the player wouldn't even know where the part goes, or unless you're making that part some kind of zone or something. plus this is an opinion

    • @Flixy207
      @Flixy207 5 місяців тому

      @@mikeartsyt89_2 i think you dont know how it works you can check a button thats called cancollide and if its disabled it wouldnt work but if its invisible it still works im a scripter builder and a animator (i just tried it out myself it works)

  • @Soos43v3r
    @Soos43v3r Рік тому +5

    OMG DUDE YOU ARE SUCH A LIFE SAVER THANK YOU SO MUCH THIS WILL MAKE MY GAME 10X BETTER!!!!!!!!!

  • @Polygonfella1662
    @Polygonfella1662 Рік тому +2

    I don’t even make roblox things I just okay it but it’s fun to watch these types of videos!

  • @StarLeaderX
    @StarLeaderX Рік тому +6

    I am so glad I subscribed to you because now I get recommended awesome videos like this. Also, I'm a game dev so I should know this, but how do I enable the outline thing when hovering over something in studio?

    • @rustysillyband
      @rustysillyband  Рік тому +2

      You should be able to go over to the top left where it says "File" and open that up. Once you're there, open up "Studio Settings.." Then, scroll down to where it says "Tools" and then turn on "Show Hover Over". If that doesn't do the trick, then scroll down and try turning up the "Hover Line Thickness" Hope this helps!

    • @StarLeaderX
      @StarLeaderX Рік тому +3

      @@rustysillyband Thank you so much!

  • @1EAS1World
    @1EAS1World Рік тому +5

    This is going to be extremely useful.. Thanks!

  • @mrleebagdatl7027
    @mrleebagdatl7027 20 днів тому

    tysm dude this helps a lot you gain a another subscriber.

  • @blueboy1069
    @blueboy1069 Рік тому +3

    Thank you very much now I'm the Find game, I say I say thank you I appreciate it and that's why I subscribe and give you a like you deserve it :D

  • @LaskoPasko
    @LaskoPasko Рік тому +1

    Bro hit the quickest backflip I've ever seen on roblox

  • @EllisPierce015
    @EllisPierce015 Рік тому +5

    love this tysm

  • @vivivpl
    @vivivpl 2 місяці тому

    THANK YOU MAN. THIS WAS REAL COOL. this tutorial was help my game. THANK YOU (i really found this tutorial 1 week)

  • @LEGOmotionclips
    @LEGOmotionclips Рік тому +1

    love u man helped me so much

  • @BonkyBoko9
    @BonkyBoko9 Рік тому +10

    How do you make it play once, so that if you step on the part again, it doesn’t play

    • @rustysillyband
      @rustysillyband  Рік тому +4

      You can either destroy the part right after that, or add a debounce to it.

    • @memercleaner
      @memercleaner Рік тому

      How would I add debounce?

    • @Rxshyyyy
      @Rxshyyyy 11 місяців тому

      set debounce to true@@memercleaner

    • @Rxshyyyy
      @Rxshyyyy 11 місяців тому

      i think so@@memercleaner

  • @Insnane_editz
    @Insnane_editz Рік тому +19

    thx so much i was searching for this for 3 weeks edit: HOW I GOT THAT MANY LIKES

  • @chinadragon27
    @chinadragon27 Місяць тому

    Player: touches block
    Rig: brings the player to the bedroom but the camera don’t follow…

  • @Sxb1nx0
    @Sxb1nx0 Місяць тому +1

    yall got to help me it starts to have a seizure idk what i did wrong T-T anyone know how to do without having it to press on anything and let the animation work by itself really need the help cant find a vid on it

  • @FloshDev7977
    @FloshDev7977 Рік тому +1

    thank you for explaining how the script actually works!

  • @JMonkeVids804
    @JMonkeVids804 4 місяці тому +2

    how do i play the animation while its anchored?

  • @sadaangaming
    @sadaangaming Рік тому +1

    sorry but if i place the dummy somewhere else it starts the animation from there but still thanks

  • @NLIOMEX
    @NLIOMEX Рік тому +2

    THANKS FOR THE VIDEO NOW I MADE A GAME !!!!!🎉🎉🎉

    • @rustysillyband
      @rustysillyband  Рік тому +1

      Congrats!!! I'd love to play it!

    • @NLIOMEX
      @NLIOMEX Рік тому

      Thanks would you mind make a tutorial on my game :)

  • @wilsonplayz1000
    @wilsonplayz1000 8 місяців тому +1

    FINALLY ALRIGHT HERES A SUB

  • @Dageometry
    @Dageometry Рік тому +1

    THANKS ALOT!!! YOU ARE THE BEST SCRIPTER!!!

  • @jshank001
    @jshank001 11 місяців тому

    This still does not work for me. The animation plays without the part but when trying to add the part it does not work. Pls help me

  • @Piggyandblue
    @Piggyandblue Рік тому +1

    Thanks so much

  • @maciejstemplewski4883
    @maciejstemplewski4883 10 місяців тому +1

    how to make this like a hitting ground with a effects?

  • @DummyMations
    @DummyMations Місяць тому

    How Do I Make When Player Touches An Part, Which Makes The Animation Play, And Then Freeze The Animation?

  • @okprogamer
    @okprogamer 3 місяці тому

    BRO THANK U SOO MUCH

  • @GamerRoanNL
    @GamerRoanNL Рік тому +2

    I used R6 so when touch it it gives me a tool

  • @Best0TH
    @Best0TH 9 місяців тому

    Its useful thanks!

  • @traianrose316
    @traianrose316 3 місяці тому +1

    how can i make it so you cant do it again?

  • @Private_edits
    @Private_edits 2 місяці тому +1

    What animation id? I really don’t understand if someone does please tell me what to do

    • @fawazalsubaie4780
      @fawazalsubaie4780 2 місяці тому

      animation ID is the ID that identifys which animation you are using, when you publish your animation, a number on the screen will pop up there, make sure to copy it

  • @Trayghu
    @Trayghu 6 місяців тому

    This is actually great you're a damn legend! Could you also do one on a script to animate a custom mesh?

    • @rustysillyband
      @rustysillyband  6 місяців тому

      Hi there! Thank you for watching, hope you enjoyed it! For animating custom meshes, you will need to first rig the character for it. You can follow along this tutorial here and you are good to go:
      ua-cam.com/video/2KdzgpHIA6s/v-deo.html
      Have an amazing day!

  • @Someonesimplewastaken
    @Someonesimplewastaken 2 місяці тому

    How do you make it when ever you click a punch will happen. Like for instance if you click four times four different punch animations will play then there will be like a cooldown once you click four times. Let’s say if you click less then 4 times after some time like 2 seconds it resets and your back to the first punch. (I know it’s a lot but thanks)

  • @AstroDev_
    @AstroDev_ 10 місяців тому

    The amination only plays for me. when other players try and trigger it it doesn't work. could you help?

  • @KottonBall_
    @KottonBall_ Рік тому +3

    And I still can’t find a video of when an animation plays when the part is clicked 😭

    • @Hewebwe
      @Hewebwe 10 місяців тому

      I need the same thinggggg

  • @erinmccullough5417
    @erinmccullough5417 10 місяців тому

    THANK YOU BRO!!!!

  • @RenzoElProYT2010
    @RenzoElProYT2010 Рік тому +2

    Can you make it pause when the animation ends?

  • @asadondahous
    @asadondahous Рік тому +2

    thx bro but my animation is going too fast can you help me?

    • @rustysillyband
      @rustysillyband  Рік тому

      You can follow this tutorial here for a simple introduction to animating. At the end, you can even learn how to adjust the speed of your animation through the script! Here it is: ua-cam.com/video/y7_9d-BcgWY/v-deo.html

  • @Kakimaki03-jd1gx
    @Kakimaki03-jd1gx Рік тому +1

    omg bro tysm

  • @MrTech335
    @MrTech335 3 місяці тому

    You sound exactly like denisdaily

  • @HudHudn1
    @HudHudn1 3 місяці тому

    can i add multiple rigs , like i have a huge animation with multiple rigs

  • @sillygoobr24
    @sillygoobr24 2 місяці тому

    Hey rusty, this doesn't seem to work for me because im using a custom rig, could you help me with this?

  • @K.I.T.T-g9f
    @K.I.T.T-g9f Рік тому +1

    Inside the (anim) Do i put the animation ID or the name? Because none of them worked.

    • @rustysillyband
      @rustysillyband  Рік тому

      You would put the AnimationID inside of the animation.

  • @-aliyahsrevenge-
    @-aliyahsrevenge- Рік тому +1

    print("hello")
    roblox studio when into python mode 💀

  • @Adaplatq
    @Adaplatq 3 місяці тому

    how to make it not repeat, so the animation would go only once

  • @Melbiza
    @Melbiza 10 місяців тому +1

    How do I Make it so the Character Deletes after the animation plays

    • @rustysillyband
      @rustysillyband  7 місяців тому +1

      You can simply use:
      game.Workspace.Rig:Destroy()
      That will destroy the rig if it is inside of workspace. Thanks for watching!

  • @FlamingSpiral20
    @FlamingSpiral20 2 місяці тому

    Where the hell do you find IDs to animations

  • @exwaizee
    @exwaizee Рік тому +2

    How to make it so that it plays forever without stopping?

  • @JustASimpleMan07
    @JustASimpleMan07 4 місяці тому

    I cant even animate a dummy walking 😭 this sh** to hard

  • @Archerknight21
    @Archerknight21 7 місяців тому

    but wait how to make it touch it a part that I want to touch because what if you have a lot of parts

  • @nebilimkanaladistexd9577
    @nebilimkanaladistexd9577 Рік тому +1

    how do i animate 2 rigs at the sime time?

  • @TheCatThatsBatman
    @TheCatThatsBatman 4 місяці тому

    "First off"🤠🤓
    Bro im not being rude
    I love u so much but your voice is just funny LOL
    People may say How? HOW IS IT FUNNY" it just is to me which is a compliment bro

    • @rustysillyband
      @rustysillyband  4 місяці тому

      I'm glad it makes you laugh lol! Thanks for the encouragement!

  • @FireFoxM11
    @FireFoxM11 2 місяці тому

    just realized how the hell do u connect them

  • @limonimon1021
    @limonimon1021 8 місяців тому

    Help guys it doesn't work for me i made my animation and copied the script what do i do ?

  • @testter-pr6hj
    @testter-pr6hj Рік тому +2

    How to make a Custcene play when the part touched?

    • @rustysillyband
      @rustysillyband  Рік тому +1

      I've got a great tutorial on that! ua-cam.com/video/BYUJNClwD0c/v-deo.html here's the link!

  • @xkerfuffIe
    @xkerfuffIe 3 місяці тому

    this is good and all, but what if im clicking the part?

  • @JoeWoopcan
    @JoeWoopcan 7 місяців тому

    is there a script when you click it with a click detector it starts the animation?

  • @LegenderStudio-n1i
    @LegenderStudio-n1i Місяць тому

    A video which need 1B views is this video u know what moatly people really dont knw and they really need the script and toturial ❤😭❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤

  • @Flixy207
    @Flixy207 5 місяців тому

    if the name of your part is different then change game.workspace.PartName.Touched

  • @ButterPrince345
    @ButterPrince345 3 місяці тому

    What’s the name of this animating app? Plz

  • @Reiin.y
    @Reiin.y 7 місяців тому

    how do you do this with moon animator?

  • @elonmasuk1780
    @elonmasuk1780 Рік тому +1

    How do i make it play once

    • @Billy-gm4wl
      @Billy-gm4wl Рік тому +1

      local anim = script.Animation
      local humanoid = script.Parent.Humanoid
      local debounce = false
      local animTrack = humanoid:LoadAnimation(anim)
      game.Workspace.Part.Touched:Connect(function(hit)
      local player = game.Players:GetPlayerFromCharacter(hit.Parent)
      if player and not debounce then
      debounce = true
      animTrack:Play()
      end
      end)

    • @rustysillyband
      @rustysillyband  Рік тому

      Thanks so much for helping!

    • @elonmasuk1780
      @elonmasuk1780 Рік тому

      @@Billy-gm4wl Thanks :)

  • @danish123_xd4
    @danish123_xd4 Рік тому +1

    How to play camera animation after touch part

    • @rustysillyband
      @rustysillyband  Рік тому

      I've got a great tutorial right here for ya: ua-cam.com/video/BYUJNClwD0c/v-deo.html

  • @UltraSnate-nh3rf
    @UltraSnate-nh3rf 3 місяці тому

    How do I see what my animation id is?

  • @bacongroup10
    @bacongroup10 10 місяців тому

    what happens when i use moon animator??

  • @karamel6239
    @karamel6239 Рік тому +1

    bro why i see the animation but my beta testers dont see it?

    • @rustysillyband
      @rustysillyband  Рік тому

      If you made the game in a group, you need to publish your animation with the creator as your group. Otherwise, if you're sharing a game with someone else, you need the owner of the game to publish and use the animation.

    • @karamel6239
      @karamel6239 Рік тому

      @@rustysillyband i do game in group and publish animation in group but in roblox animation see only me what the problem?

    • @karamel6239
      @karamel6239 Рік тому

      @@rustysillyband Man TYSM i finally do my game i do it 1 years with my team TY!!!!! we do great cut scene

  • @beigemachine549
    @beigemachine549 Рік тому +1

    how do you paste your id?????

  • @PcMatch
    @PcMatch 4 місяці тому +1

    What coding language is it?

  • @Enovity
    @Enovity Рік тому

    is there a way to make the animation play once the player holds e on a part?

  • @defenetlynotayoutuber
    @defenetlynotayoutuber 2 місяці тому

    How do I get the animation id

  • @hivssvx
    @hivssvx Рік тому

    from where i got id animation?

  • @SevenBread-BrawlStars
    @SevenBread-BrawlStars Рік тому +1

    Make a animation game

  • @Elude_SunGod_race_ghoul
    @Elude_SunGod_race_ghoul 2 місяці тому

    Where do I find my animation id

  • @qmeliaa
    @qmeliaa Рік тому +1

    how to see two animations at the same time

  • @Kanaya_Julielle
    @Kanaya_Julielle 6 місяців тому

    How do you copy animation id?

  • @Halk-ion
    @Halk-ion Рік тому +1

    I have just learned right now that Roblox uses python.

    • @rustysillyband
      @rustysillyband  Рік тому

      Unfortunately not. Roblox Studio uses a custom version of LUA called LUAU.

  • @AzlanSucksAtRoblox
    @AzlanSucksAtRoblox Рік тому

    Is it possible to make it so taht our character does the animation?

  • @Robloxcentralpoopedat1000subs

    Idea: can you do the same thing but when you touch the part a sound plays? ty :))

  • @spongeroffical
    @spongeroffical Рік тому +97

    how to make the easiest basic jumpscare:

    • @ELVR_YouTube
      @ELVR_YouTube 4 місяці тому +6

      not me remaking the batim "boarded up ink machine room" jumpscare

    • @random_youtuber666
      @random_youtuber666 Місяць тому +1

      This is literally what i used it for

  • @battlestevieonyt
    @battlestevieonyt Рік тому +146

    Dude, thank you so much. I couldn't find out how to do this, but you made it easy. You are an absolute life saver thank you so much. you earned a subscriber

    • @1LightZ7
      @1LightZ7 Рік тому +5

      agreed

    • @OliverCole-n6z
      @OliverCole-n6z 6 місяців тому

      69

    • @Joekidyt
      @Joekidyt 4 місяці тому

      HOW DO I COPY AND PASTE THE ANIMATION ID

    • @Joekidyt
      @Joekidyt 3 місяці тому

      WERE IS ANIMATION ID

  • @Jlian_VR
    @Jlian_VR 4 місяці тому +33

    You don’t know how helpful this video was, I’m just glad it was short and easy this is one of my favorite tutorials ever!

  • @deaththor
    @deaththor Рік тому +23

    Cool! i just want to know how to make the player do the animation

    • @kaksonito
      @kaksonito 8 місяців тому

      Mee to

    • @kaksonito
      @kaksonito 8 місяців тому

      I don t know

    • @boobielou21
      @boobielou21 3 місяці тому

      R u dumb just go to animation editor

    • @guaroontheracoon
      @guaroontheracoon 2 місяці тому

      Put It into the StarterCharacterScripts

  • @thelampgamer
    @thelampgamer Рік тому +2

    Please one-v-one me in fortnite

  • @zazmraz
    @zazmraz Рік тому +27

    My brother has been wanting something like this forever. Thank you for a tutorial that is simple and makes sense 👍

  • @DuckyIsLive
    @DuckyIsLive Рік тому +4

    how do I add a Cooldown to the part?

    • @nysreme7
      @nysreme7 Рік тому +4

      local debounce = 3 --how long the cooldown will be in seconds
      local dummy = --your dummy here
      local animation = --your animation here
      local animator = dummy:WaitForChild("Humanoid").Animator
      local animTrack = animator:LoadAnimation(animation)
      local part = --your part here
      part.Touched:Connect(function(hit)
      if game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) and not animTrack.IsPlaying then
      animTrack:Play()
      task.wait(debounce)
      end)

    • @nysreme7
      @nysreme7 Рік тому +1

      omg i just realized the code doesnt work i am so sorry

  • @A-200ClipsOldCody
    @A-200ClipsOldCody Місяць тому +1

    I asked my dad since he was a great LUA user, and he said that if debounce = nil then debounce doesn’t have a meaning
    Edit: and for the if player and debounce == nil part, then replace with if player then because debounce has no meaning
    Edit 2: without the nil, we will have this
    local anim = script.Animation
    local humanoid = script.Parent.Humanoid
    local animTrack = humanoid:LoadAnimation(anim)
    game.Workspace.Part.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
    animTrack:Play()
    wait (1)
    animTrack:Stop() - If you want the animation to loop, remove this
    end
    end)

  • @NOTJACKDOODS447
    @NOTJACKDOODS447 Рік тому +19

    Alright Guys If You Need To Do A Custom Avatar then heres The Steps:
    add the animationcontroller into a humanoid you insert
    make ur animation
    insert a script the add an animation inside it
    copy this script:
    local anim = script.Animation
    local humanoid = script.Parent.Humanoid
    local animTrack = humanoid:LoadAnimation(anim)
    local debounce = nil
    game.Workspace.Part.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player and debounce == nil then
    debounce = true
    animTrack:Play()
    wait(1) -- Change this to however much time you want to wait until the animation can play again.
    debounce = nil
    end
    end)
    make sure to change the part to your parts name
    And Test it!

  • @Yuri-not_real
    @Yuri-not_real Рік тому +9

    Thank you I'm gonna start learning from you dude I really wanna get good at animation and start my own channel hopefully I learn fast

  • @AgentGilded
    @AgentGilded Рік тому +8

    If anyones wondering how to make the person disapear after it's over, you need to place another part in the same spot as the animations player, and put this script in the part:
    script.Parent.Touched:Connect(function()
    wait(6)
    game.Workspace.MODEL_NAME_HERE:Destroy()
    end)
    Make sure to change the number after 'wait' to however long it takes to play the animation.
    i was gonna ask how to do this, but i figured it out myself lol

  • @Train2822
    @Train2822 Рік тому +4

    I saw you in Roblox Studio that was named “NPCTesting”, were you using it for this one?

  • @classicsonicsim
    @classicsonicsim Рік тому +8

    For people who dont know how to find the id, when you make the id and publish it, dont press cancel and look at the thing below the name of the animation and youll see the id and you can write it on a paper or copy and paste

    • @faelogamer6348
      @faelogamer6348 11 місяців тому

      THANKS GOD I WAS STRUGGIYLNG TO FIND THE ID

    • @zoutweliaiscool
      @zoutweliaiscool 9 місяців тому

      actual lifesaver my man

    • @Joekidyt
      @Joekidyt 3 місяці тому

      i STILL CANT FIND IT im so confused

  • @ibrahim_gamer2
    @ibrahim_gamer2 10 місяців тому +1

    Where can you find the animationID

  • @michaelrobloxisback
    @michaelrobloxisback 3 дні тому +1

    does it work by moon animator

  • @vesmanYT
    @vesmanYT 7 місяців тому +1

    when i touch block it doesnt work...

  • @KralFrisell
    @KralFrisell 11 місяців тому +1

    how can I only 1 play animation

  • @ครูไชยวิทย์
    @ครูไชยวิทย์ 7 місяців тому +1

    Diamonds mabye dont use with anything :/

  • @Atlas_TheAdventurerOG
    @Atlas_TheAdventurerOG 4 місяці тому +2

    That's Amazing, but do you know how to make a NPC peek like Opila Bird in garten of banban so when you look at the npc it plays a slide animation and unloads?

  • @deletemaster4786
    @deletemaster4786 Місяць тому +1

    You forgot the first step.
    First get a PC 😭

  • @emeraldgaming2854
    @emeraldgaming2854 Рік тому +1

    It doesn’t work even though I copied it word for word