BEST Way To Animate In Scratch

Поділитися
Вставка
  • Опубліковано 27 вер 2024
  • In today's Scratch tutorial, I show the BEST way I know how to animate with code. More specifically, I show how to switch the costumes so that they animate smoothly and without delay.
    Let's get coding!
    Thanks for watching! Please hit the like button and subscribe for future Scratch tutorials!
    🔗 LINKS:
    ▶ Scratch Profile Page:
    scratch.mit.ed...
    ▶ All Videos In This Series:
    • Scratch 2 Player Tank ...
    ▶ ShiftClickLearn Community:
    • SCL Scratch Community
    ▶ Scrolling Platformer (Night Ninja):
    • Scratch | Scrolling Pl...
    ▶ Cat Clicker tutorial:
    • Scratch | Cat Clicker ...
    ▶ Crossy Road tutorial:
    • Scratch | Making a Cro...
    ▶ Tower Defense tutorial:
    • Scratch | Making a Tow...
    ▶ Fish Game tutorial:
    • Scratch Tutorial | Hun...
    ▶ Scrolling Platformer tutorial:
    • Scratch Tutorial | Eas...
    ▶ Combat Based Platformer tutorial:
    • Scratch | Making a Com...
    ▶ Space Shooter game tutorial:
    • Scratch Space Shooter ...
    ▶ How-to tutorials:
    • Scratch | How-To Tutor...
    😸 Get Scratch Addons:
    scratchaddons....
    ❗ DISCLAIMER: This video is family-friendly! Hostile and/or rude comments will not be tolerated!

КОМЕНТАРІ • 311

  • @ShiftClickLearn
    @ShiftClickLearn  2 роки тому +59

    Hi everyone! I hope this tutorial helped you out animating your characters! :D

    • @michaelchen3086
      @michaelchen3086 2 роки тому +2

      Woooohooooo

    • @nakulojha1366
      @nakulojha1366 2 роки тому +1

      thanks its very helpful🔥🔥🔥

    • @Geezi24
      @Geezi24 2 роки тому +1

      It did for sure! Next u could make a animaiting/drawing tutorial!

    • @cringeman828
      @cringeman828 2 роки тому +2

      yea

    • @naturelist
      @naturelist 2 роки тому +1

      Right what I needed!

  • @nathanruhstofer830
    @nathanruhstofer830 Рік тому +24

    You know.... I've always followed tutorials but never understood why they put the blocks here or there, but you explained how it worked and I was finally able to understand! Thanks a lot!!

  • @BestBoi8
    @BestBoi8 11 місяців тому +5

    For anyone who wants the time until the frame swaps to be consistent (not switching to walk anim1 and instantly switching to walk anim2) You can reset the _costume variable when your "if moving" variable updates (this worked for me but idk if it works perfectly in the tutorials exact code since mine is slightly different)

  • @austencope
    @austencope 2 роки тому +40

    Thank you so much for this! I was trying to make a script that makes the animation play at different speeds, and this is exactly what I was looking for!

  • @Geezi24
    @Geezi24 2 роки тому +6

    Congrats on 9k dude! You definetly deserve it! 💯💯

  • @JoshuaDixon-n9x
    @JoshuaDixon-n9x 2 місяці тому +1

    TYSM! I always wanted to learn how to animate a character in a game and now thanks to you I can.

  • @N64Mario
    @N64Mario 2 роки тому +13

    That's an interesting trick to use that kind of script for animating sprites, and it works for most cases.
    However, there are some cases when you want to animate a sprite with their own frame time value. For example, frame 1 may want to last 4 frames, frame 2 may want to last for 1 frame, and frame 3 may want to last for 8 frames. With the mod trick here, you don't have that kind of freedom because every frame is connected to a single value of the _costume variable there.
    Nevertheless, this a great tutorial Nice job!! :)

    • @jeffreygordon7194
      @jeffreygordon7194 2 роки тому +8

      In that case you could just duplicate the frames. That's usually what I do. This is pretty common to see in sprite sheets in commercial arcade games.

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +6

      Good point, thanks! :D

  • @Rory432
    @Rory432 2 роки тому +4

    Nice! I’m definitely going to show this to the guys down at my animation club!

  • @jdnnle6
    @jdnnle6 2 роки тому +9

    Thank you so much for this! I was trying to make a script that makes the animation play at different speeds, and this is exactly what I was looking for!

  • @Wallee580
    @Wallee580 2 роки тому +7

    Hello Owen!
    Can't wait to you reach 10K subs :p

    • @nikolangot
      @nikolangot 2 роки тому +3

      who is owen?

    • @Wallee580
      @Wallee580 2 роки тому +2

      @@nikolangot Owen is ShiftClickLearn's actual name, you don't think his birth certificate has his channels name on it do you? :p

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +3

      Hiya! I can't either!

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

    Bro has no idea how much he helped me. I got 23rd place in a game jam for kids (scratch only) , everyone's animations were choppy but mine weren't thanks to this guy :)

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

    you can use the round block to fit the entire animation in 1 single line (also you can use timer instead of a variable, which reduces file size by not alot but i thought i'd say that)

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

      You wanna know what im planning on?

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

      @@Nightgames_YT_949 ...sure

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

      @@kostasismename9493 Im planning on to make a Fanmade Murder drone movie.With good ending.

  • @AnArcadeMan
    @AnArcadeMan 2 роки тому +3

    Hey ShiftClick can you do a tutorial on how to make the google Scoville game. and i loved the viedo

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +2

      I haven't played that game. I will have to check it out!

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

    Thanks a lot. Im saved from depression wasted a lot of hours trying to find a way to do this. Scratch really have a confusing way to animate costume when you are a beginner. I can't use things like while, released, and some operators. Many in youtube just using 2 costume way which they just use like in The video where its not a fricking chance where I have like 20 frames for running, 30 frames for jumping and etc, it will waste a lot of space and time,even if we disregard that its also not looking smoothly. So yeah thanks a lot

  • @geodelire
    @geodelire 2 роки тому +2

    Honestly you deserve 100k subs btw i was here when you had 3k

  • @Nayrlol6855
    @Nayrlol6855 2 роки тому +1

    For people with the scratch addons addon i sugegs you do change costume to say broadcast 1 change costume to say broadcast 2 then right click anywhere click clean up blocks+

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

    this tutorial is actually the best animation i've ever seen. im doing this on a laptop and there's NO LAG.

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

    It's a great video, and it had helped me a lot. However, I have a question. I'm doing a fighting game, and for animations like Idle and walking this is very useful, however, when i'm trying to do a punch, how do you make that an animation runs just 1 time without using waits? Is it possible, or it's just better to use the old method (with waits and stuff)

  • @bigman8085
    @bigman8085 2 роки тому +3

    Thank you so much for this tutorial

  • @javascript7817
    @javascript7817 2 роки тому +6

    Really cool! Sometimes math can save a ton of headaches!

    • @Mari0Kid1234
      @Mari0Kid1234 2 роки тому

      That’s a reason I love math :)

    • @JointFury
      @JointFury 2 роки тому

      Apart from when math causes headaches lol

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

    Is it really not possible to import a premade video directly into the code?
    Like some sort of "play animation" or "play video" that just plays the video you importeted?
    Does everything HAVE to be frame by frame?

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

      yep
      3 months later

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

    Thank you for this video you saved my life with scratch

  • @rlawrence678
    @rlawrence678 2 роки тому +2

    I'll use these tips

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

    I usually use “When space clicked next costume” and there’s usually one sprite and I consider the costumes as “Frames” (My animations are usually simple and I copy and paste from other sprites)

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

    Thanks man i was actually struggling on the loop problem and once i'm about to quit i came by ur video. Keep it up!

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

    Thank you so much for this video!!!You help me to complete a animation on scratch

  • @paperjoe
    @paperjoe 2 роки тому +1

    Thanks! I was trying for 1 week to do this by myself and i couldn't do it. Subscribed!

  • @gravesilk322
    @gravesilk322 2 роки тому +1

    How r u so underrated??? Your tutorials are so easy to follow and you are rlly funny aswell!!!

  • @Geezi24
    @Geezi24 2 роки тому +3

    Hey ShiftClickLearn could you make a scrolling backround or someting simmilar to that tutorial? i have trouble figuring out how to make a scrolling backround if the charecter follows the mousepointer! (#hope -u-get-to-10k!!!!!!!!)

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +2

      That is a great idea! I'll remember that one!

  • @HaleyRicks-o6e
    @HaleyRicks-o6e 2 місяці тому

    So there’s one way if you want to make this more hard, you just do one forever block and get the go to next costume block put it inside the forever block.
    And then your done ✅ but for beginners look at this video instead but for serious pros who want animations to look good do the code I said.

  • @terkq
    @terkq 2 роки тому +2

    ShiftClickLearn, may you try making a word search scratch video ? I saw Scratch has lots of project about wordle and more... Hope my idea is helpful for you

  • @danstevers
    @danstevers 2 роки тому +1

    i love your tutorials😄

  • @shirou636
    @shirou636 2 роки тому +1

    how do i add a i downloaded to my soft soft so i can resetup it?

  • @corndogthehedgehog277
    @corndogthehedgehog277 2 роки тому +1

    Thanks at the first part of the vid when i did all of your code it was laggy but when i finished not anymore!

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

    I used this to make a custom block that does the switching and stuff and stuff.

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

    i used your video on hitboxes and tried to combine it with this one but the programs don’t seem to be working properly because i’m getting no animation at all. what would be the problem?

  • @lilypie5420
    @lilypie5420 2 роки тому +2

    when u reach 100k subs, will u remember me?

  • @FLoriN2
    @FLoriN2 2 роки тому +2

    Nice script, thanks!

  • @dolliethedoll
    @dolliethedoll 2 роки тому +4

    me: what a nice day to watch ShiftClickLear-
    wifi: hi
    me: nvm

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

    i really apreciate your help with dowloanding this software

  • @ppoly
    @ppoly 2 роки тому +1

    hey so, i'm having a bit of trouble.
    what's going on is that i want an animation that lasts for 3 frames, then goes to an idle animation for 1 second
    the problem is that i can't find a way to make it work
    any help appreciated thank you

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      Hmm, try making a time that constantly ticks down. Then once it equals a certain value, reset it. Ex:
      when green flag clicked {
      set timer to 33;
      }
      forever {
      if (timer > 30) {
      play the animation that lasts for 3 frames
      }
      else {
      play the one that last for 1 second.
      }
      change timer by -1
      if (timer < 1) {
      set timer to 33
      }
      }
      I don't know if this will work for sure, but it should. Basically each frame it will check if the timer var is equal to 30, 31, or 32, and if it is, switch costume to the 3 frame animation. Other wise, it will play the 1 second animation 30 times. (Scratch runs at 30fps so it should run the forever loop 30 times a second.) Then once the timer reaches 0, it will start over.

    • @ppoly
      @ppoly 2 роки тому

      @@ShiftClickLearn did that, the thing is completely static now.

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

    Hi, nice trick. I am very new to Scratch, quick question. Will the variable eventually reach it's max value? Like in c#, an INTEGER has a max value of 32k or something. What are the variables treated as in scratch? I assume some kind of float or double if they use decimal points. Is there a max/min value of variables?

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

    Thanks a lot for this tutorial, the only problem is that on the 4 keys (arrrow keys) one's animation doesn't work

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

    Loved this, helped a lot with my game.

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

    something wrong.
    my character is switching into their idle in their run

  • @RedBlast172
    @RedBlast172 2 роки тому +3

    This is helpful so far!

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

    unlike you said it doesn’t work it just repeats all of my costumes to a pose of just a few pls help me

  • @LiamGames662
    @LiamGames662 2 роки тому +1

    Think you for the animation skill im gonna put you in the credits btw

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

    Thank you for this! I need to animate a cartoon for my class.

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

    thank you thats the third time i needed this video

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

    Hi! What would you do to make it so that the idle animation faces the same way when the character moves a certain direction and stops? Thank you sooo much for this video it was very helpful :)

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

      you remove the "POINT IN DIRECTION Ximput x 90"

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

    I have a problem where I cannot animate x and y directions at the same time

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

    working fine thank you

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

    for some reason the costume value SHOOTS into the ten-thousands in a second even though i have the exact code as u?! please help, is it the softwares issue?

  • @JustPlay817
    @JustPlay817 6 місяців тому +1

    So cool!

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

    tysm this works so well but one thing i need is a running animation 😭😭

  • @LeftyGamez666
    @LeftyGamez666 2 роки тому +2

    Hey! Really great tutorial, right now I'm trying to make a top down rpg game and for it to work I need to move upwards and downwards with a walking cycle too. You think you can help me?

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +1

      You'd need to play the correct animation depending on the velocity! Something like this:
      if (velocityX > 0) {
      right animation
      } else if (velocityX < 0) {
      left animation
      } else if (velocityY > 0) {
      up animation
      }
      etc.

    • @LeftyGamez666
      @LeftyGamez666 2 роки тому

      @@ShiftClickLearn It worked! Thanks bro!

  • @Rora2
    @Rora2 2 роки тому +1

    How do i do this if i set up my movement and collisions with your other tutorial for collisions?

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      You would make a platformer, then just add this animation code in a loop. (A forever loop or a when I receive loop.)

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

    Question: For the idle animation, how to you make the frame for example, go to 1-5 than go backwards, if that makes sense.

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

      Hmm, try repeating the amount of costumes in the animation, change the _costume var by a positive number, then repeating the amount of costumes in the animation again, changing it by a negative number. Ex:
      repeat 5 {
      change _costume by 0.5
      }
      repeat 5 {
      change _costume by -0.5
      }
      I think this will work. :D

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

      @@ShiftClickLearn Its okay I found another way! But thanks for your help, sounds more effective than back a dupe of the costumeXD.

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

    What are all the variables for because I am confuse

  • @yeetmeister-en8be
    @yeetmeister-en8be 8 місяців тому

    im making a rpg game thank you I love your videos

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

    incredibly helpful, you deserve a sub!

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

    how would I do this with more complicated animations?

  • @charlesenzotimola9073
    @charlesenzotimola9073 3 дні тому

    pls amke a tutorial for the walk cycle for a lot of frames

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

    @ShiftClickLearn hey is there a way to play different animations like a jump into a idle if there is can you respond

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

    Thanks for the help.

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

    If im trying to make a full on animation, is there any way to recreate tweens and frame transitions?

  • @priyankakapoor4426
    @priyankakapoor4426 2 роки тому +1

    Can we move and jump the uploaded sprite

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      What do you mean? You can use any costumes/sprites with this if that's what you're asking.

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

    thanks
    you don not know how much i wanted to do this :)

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

    This guy is a legend

  • @craigonduty9274
    @craigonduty9274 2 роки тому +1

    i love your videos

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

    Hey there, i want to create clones with many animations playing at once, how much can scratch handle before being slowed down?
    ?

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

    This is helped me. Thanks

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

    I followed the instructions, but I think mine is too complex for that, so it isn't working.

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

    Hello, for me when i start walking around it also plays the idle animation while im walking.. Also, could you make something on how to make a jumping animation with multiple costumes? Thanks :)

  • @King-jmw5110
    @King-jmw5110 2 роки тому +1

    this vid was so helpful but i dont know how to make my sprite not walk we'll i jump and move new vid idea.

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому

      Thanks! You just need an if statement that checks if you are jumping, then play the jump animation stuff! :D

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

    Thx this really helped

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

    How do i make it go up?

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

    What is the xinput

  • @nikolangot
    @nikolangot 2 роки тому +1

    can u pls add the code so the sprite can be controlled by w and s (up and down)

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +2

      I can make a tutorial on basic movement- this video's focus wasn't really the movement!

    • @nikolangot
      @nikolangot 2 роки тому

      @@ShiftClickLearn ok thx!

  • @belustergaming2179
    @belustergaming2179 2 роки тому +32

    This is way to nerdy for me to understand.....

    • @ShiftClickLearn
      @ShiftClickLearn  2 роки тому +9

      Lol sorry

    • @Jo-TryHard
      @Jo-TryHard 8 місяців тому +1

      Just copy the code or stacks u don't need to understand

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

      Rip brain cells

    • @Mxnamoto.
      @Mxnamoto. 8 місяців тому +4

      @@ShiftClickLearnnah bro u did a good job at explaining everything

    • @t-beatsmsm
      @t-beatsmsm 6 місяців тому +1

      Lol

  • @smalllynx9031
    @smalllynx9031 2 роки тому +1

    Funny vid...nice job

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

    how do i make this work in mobile?

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

    ty

  • @TropialGamingYT
    @TropialGamingYT 2 роки тому +1

    Wow good video

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

    121K views as of this comment? That shows how little effort people are putting into their CS50 projects. This guy shows us how to excel in our homework.

  • @numberblock796
    @numberblock796 2 роки тому +2

    epic video

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

    Nice

  • @viniciusoliveira3692
    @viniciusoliveira3692 2 роки тому

    the ways be like
    hards: easy no give ups B)
    simples: somebody lost his brains pls help

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

    the subscribe button has a new animation

  • @Andr3G908
    @Andr3G908 2 роки тому +2

    WOOOOWOWOWWWW WWOWOWOWO IM COMMENTING ON VIdEo

  • @zluppyppy9789
    @zluppyppy9789 2 роки тому +1

    Mine Doesn't Work :(

  • @teeeverett3749
    @teeeverett3749 16 днів тому

    It did

  • @firstofthesame150
    @firstofthesame150 2 роки тому +2

    I have my profile

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

    Not Working

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

    sorry, but for for some reason it not working

  • @purnamadwi1940
    @purnamadwi1940 2 роки тому +1

    OK

  • @GhostK-wh7qy
    @GhostK-wh7qy Рік тому

    can u animate to jump😅

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

    it din't work😭😭😭

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

    WAHT????????