Collisions in Scratch - The EASY WAY

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 218

  • @AFellowObjectShowFan
    @AFellowObjectShowFan 11 місяців тому +31

    how to make a hitbox:
    Make a costume with your hitbox (and ofc the player costume) use this code:
    When green flag clicked
    Forever
    switch costume to hitbox
    switch costume to player
    This happens because the script at the end always goes last.

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

      Thanks 👍

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

      what happens if its a game were you jump mine is

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

      X

    • @PickleNugget-tk6bw
      @PickleNugget-tk6bw Місяць тому

      @@AFellowObjectShowFan or you could make a different sprite and you could have the other sprite(costume) move to the hitbox.

  • @JJWarriorBlade
    @JJWarriorBlade 7 місяців тому +5

    Why did I think of this, “-1” times “x” will equal the opposite of the value inputted. My collision problems are over. Also Mythic Pixels for the win 😂

  • @bigfatsnakeviiper
    @bigfatsnakeviiper  Рік тому +21

    Comment any tutorials that you would like to see from this channel.😀

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

      gravity/jumping please

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

      @@meowmeow6743 I've actually already done that in this video: Simple Jumping Physics in Under a Minute
      ua-cam.com/video/rk5iz8XFMpw/v-deo.html

    • @profiley.
      @profiley. Рік тому +3

      Clicker game please

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

      heyy viper im rlly just a beginner and idk how to hide and restart the game when i lose

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

      How to make an RPG

  • @Pugsman217
    @Pugsman217 24 дні тому +1

    THANK YOU SO MUCH, I've watched so many videos and this one worked. Who knew the shortest video is the best. Thank You!

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

    yo you really helped me to make good movement for my game and collision. you are VERY underrated you are pretty good tbh

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

    This Was the BEST tutorial I’ve seen on collision. I will be using this in the future!

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

      Thank you!

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

      I have a question does it work in games that have a geometry dash style? that are like from the side and have jumping instead of going up?@@bigfatsnakeviiper

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

      @@ArtscoStudioShorts It depends on which jumping code you are using, but in a lot of cases it will work.

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

      oh ok. Im asking because im using my own movement code and since ur making the collision physics by amplifying your own script i was just worried it might not work@@bigfatsnakeviiper

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

    ur channel is the best, it helps me out so much!!!! i remember the easy movement and i can do it by myself now! i honestly can not thank you more.

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

    I love your videos dude, seriously these short and sweet tutorials are not only easy to understand but are also real time savers I was use to having to watch 25 minute videos breaking all of this down but you managed to do it in just 2. You deserve more subs. Easily one of the best scratch youtubers.

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

    scratch cat my boy keeps phasing through walls and going "HEEELP HEEELP HEELP MEEE HEEELP"

  • @abel.studios.17
    @abel.studios.17 10 місяців тому +6

    Thanks for the tutorial, I really needed it for an RPG game 😊

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

    Simple and awesome tutorial, + sub, and a huge respect. I am not a beginner in Scratch but anyway this tutorial saved me from loosing tons of time. Very useful!

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

    Love your vids! Keep up the good work :))

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

    making a pizza tower-esque game on scratch and you wouldnt believe how much your tutorials helped me

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

    Thanks soo much Viiperr! I really needed this for my game. I appreciate it!

  • @islemgaming201
    @islemgaming201 11 місяців тому +3

    You got a new subscriber :D

  • @elfboy-productionzz6815
    @elfboy-productionzz6815 Місяць тому

    Another tutorial by this guy that I needed, ty!

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

    editing skills 11/10 keep it up :)

  • @KingMichael-z4n
    @KingMichael-z4n Рік тому +3

    im not a scratch developer but i like watching this channel

  • @solomonimie7821
    @solomonimie7821 9 місяців тому +7

    viperr > khan academy

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

    Good topic. Good explanation 😊😊

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

    Thank you so much. I've never understood collisions in Scratch. It turns out that by "touching" it means to overlap the sprite you want to touch.

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

    Wow!Great Job!🎉🎉😊.

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

    Also it can be 0 - x vel

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

    You also can make like this:
    put forever, if touching (Wall) then move ( negative player speed )if the wall if on right side or
    ( player speed ) if the wall its on left side
    hope you understand

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

    Thank you so much! My old collision system just made the wall like Glue. This has fixed that issue!😁

  • @j1studio-oz5hc
    @j1studio-oz5hc Рік тому +4

    What time do you upload

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

      I don't have a particular upload schedule, but you can expect a video ever week or two.

  • @Shock_wave_fan
    @Shock_wave_fan 22 дні тому

    Thanks this was really helpful

  • @AndrewPlayedThis-jv9zz
    @AndrewPlayedThis-jv9zz 9 місяців тому

    Thanks for the help before mine colison and movement were very laggy and now they are very smooth thanks!

  • @KingMichael-z4n
    @KingMichael-z4n Рік тому +2

    i have a video idea if its possible to do : try make a game where u have to dodge the exploding barrel from the sky and the longer you survive you get points (rest is optional) you can make a store for the points with powerups

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

      I will keep that in mind.

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

      what do you mean "if its possible to do"? this is a game engine,of course you can make any game no matter how complex

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

    great job! could you do a video about the easiest way to raycast?

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

    W I love ur channel keep it up mate!

  • @scratchtutorials-nf9zq
    @scratchtutorials-nf9zq 11 місяців тому +3

    thanksssssssss for this video i am making among us😀😀😀😀😀😀😀😀😀

  • @tysonwest9338
    @tysonwest9338 21 день тому

    I was having a huge bug with a wall clipping problem, realized it was because I didn't replace the change x with a change y.

  • @Ocean10230
    @Ocean10230 11 місяців тому +6

    My Scratch cat head stuck in the celling when trying to collide

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

      same

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

    Helps me with my TWHG Testing project.

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

    Can you make a video about how to easily make gravity In games?

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

      I've actually already done that in this video: Simple Jumping Physics in Under a Minute
      ua-cam.com/video/rk5iz8XFMpw/v-deo.html

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

      @@bigfatsnakeviiperI thanks I didn’t see that because it was a short lol

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

    bros the reason good job exists

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

    I have a question. Is there a way to make this work for a simple AI, which just points towards the player and moves?

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

    Just subed

  • @Endguy-e300
    @Endguy-e300 6 місяців тому

    Thanks man that helped a lot. Like and Sub

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

    how did you get the theme color on green?, also cool video

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

    Thanks man! Its really helpfull

  • @danni_gacha0
    @danni_gacha0 7 місяців тому +2

    Haha now i will make a...... PLATFORMER 👹👹👹👹

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

    this help TYSM!

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

    2:17 he go into da backrooms

  • @PPurps
    @PPurps 11 місяців тому +3

    Online?
    If you can't I don't mind making games without online
    But if you can please tell me ❤
    Also, I love your tutorials you getting a new subscriber!!!

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  11 місяців тому +3

      I will consider making a video on that subject in the future. :)

    • @PPurps
      @PPurps 11 місяців тому +3

      @@bigfatsnakeviiper thank you ❤️

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

    hello, I have the exact same movement code as you exact same collision code as you but when I run the game and try to use wasd my ctrls are inverted and scratch is jumping in steps like change y by 2 each time I press w/s same for a/d

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

      Nvm I was just being dumb :D

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

    How do I make it go in the opposite direction when a sprite touches it

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

    I did that and that didnt work i used offline editor

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

      Can you please tell me what part didn’t work?

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

      @@bigfatsnakeviiper i tried that and it was so bad that when i go to the center collision occurrs

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

      I'm sorry to hear that. Do you perhaps have a Scratch account where you could post what you have so that I can fix what is wrong?

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

    great!

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

    My way to make collisions is making two variables, old x and old y, put them in the top of the forever loop and when the "Player" sprite is colliding with "Ground" set x to old x (put it after the "change x by "x vel"" variable). And the same for y

  • @MiniConDog
    @MiniConDog 5 місяців тому +1

    for some reason your cat stays still but mine like bounces off the wall??

  • @томни
    @томни Рік тому +2

    Collision chain

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

    x vel in german???

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

      x Geschwindigkeit (x gesch) im guessing

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

    I just put it in my back pack so I don't have to do the script again =]

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

    can u make tut for vertical collisions

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

      Vertical colisions work with this tutorial

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

      @@bigfatsnakeviiper ermm, when i watched it till the end, vertical colission are in there so my bad but if i recreate this tut it just slows my player instead of tottaly stopping it

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

    I'm making a game where the player isn't restricted to just changing the x and y directly when moving, the player can rotate freely and move forward/backwards/side to side relative to their direction. How would I change this code to accommodate this?

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

    Coming soon.. Collisions in Scratch - The HARD WAY

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

    cant see x vel

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

    thanks

  • @Ender1667
    @Ender1667 6 днів тому

    Good Tutorial But I'm Having An Issue With The Y Collisions. When The Player (In My Case, The Red Bird From Angry Birds) Touches The Level From The Y Axis He Goes Through The Ground Slowly And At A Diagonal Angle. This Doesn't Happen For The X Axis And I Have Been Following The Tutorials Making Sure Everything Is Like The Code Shown. Still, Good Tutorial.

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

    i used all three of your tutorials but when I go on top of an platform in stops the cat from moving how do I fix that?

  • @Epikkity
    @Epikkity 26 днів тому

    I did exactly what you did and it just the collisions just make the play slow down, please help

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

    For some reason my player can still go through the ground but just slower

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

      Make sure that your set x vel to x vel *0.8 blocks are above your change x by x vel blocks. (Do the same thing for y)

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

      @@bigfatsnakeviiper It is, i dont know wh its doing this

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

    yo when I try to make like blocks that my character can collide with (ground in your case) the hitbox of the whole sprite becomes a cube and my character is always in it, how do I fix this?

  • @tinydangerfox7542
    @tinydangerfox7542 10 днів тому

    when i tried this the character sprite phased through the wall. i have read some of the comments and nobody else has had the problem where the code does nothing if someone can figure out why it doesn't work for me that would be helpful.

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

    annd what happens if i dont use a smooth movement and instead use the
    (move ( ) block)?

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

    Very extremly good tutorial but there's a problem, the player isn't actually touching the level. It is one pixel further.

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

    I dont understand but when i was testing the y coordinates the sprite starts to go diagonally could u help i tired doing as you said step by step but didn't work pls help(i use scratch 3

  • @devinscinta9500
    @devinscinta9500 10 днів тому

    How can this be done with clones?

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

    uhh with me it just keep bouncing off and when its on Y axis it simply freeze, i think its a problem with my other piece of the code

  • @Light_hehe
    @Light_hehe 9 днів тому

    What is xvel

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

    wen i walk in a wall (with ate code) it sends it back by 6. (i some how made a bouncy wall while trying to fix it)

  • @marielamb-doyle654
    @marielamb-doyle654 6 місяців тому

    How do we make Controls
    for mobile

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

    Good tutorial, but can't you just do if touching (sprite) move -10 steps?

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

      That wouldn't work. Because the momentum is more than 10 steps, the player would eventually go inside walls.

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

      @@bigfatsnakeviiper Thank you for telling me :D
      i recently noticed that while working on a project.

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

    How do i make it so my guy won't slow down before hitting the wall

  • @bario.
    @bario. 11 місяців тому +2

    "easy way"

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

    Hey uhm just wondering if you can help on wall collisions, ive watched alot of tutorials and unfortunately none of them seem to be working? im currently making a game for our school project and a little assist could help, if you're interested i can send you the link of our game to see for yourself. THANK YOU! :)

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

      Thank you very very much

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

    what happens if its a game were you jump??? mine is

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

    Where do i find the x vel block

  • @hirjinjiemoe-vx3mr
    @hirjinjiemoe-vx3mr 2 місяці тому

    Does this works for scrolling game?

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

    Make a more advanced one because I FOUND A WAY TO CLIP THROUGH WALLS IN MY FIRST 1 MINUTE OF TESTING.

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

    W

  • @inaeythorsdottir9426
    @inaeythorsdottir9426 11 місяців тому +2

    I use a simpler way then that

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

    How to make it so when a sprite touches a sprite you die

  • @robertgabrielradau2955
    @robertgabrielradau2955 25 днів тому

    bro for me is just makeing me go in the x val i to the walls and only the y val woarks

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

    after i did the collision detection my sprite cant move for some reason? can someone tell me why

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

    Cool video but are you already did this in the platformer video

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

      Yes I have, but this is for my smooth movement scripts which is better.

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

    it dosent work bc my sprite follows the mouse pointer

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

    For some reason when my sprite goes up to walls, the collision doesn’t work. But works when it hits walls going left or right, idk how to fix that 😅

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

      Make sure that you didn’t use a change x by block in both if conditions. If that’s not it, make sure you didn’t use the x vel block in both if conditions. I hope this helped. 😁

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

      @@bigfatsnakeviiper I accidentally put “change x by y vel x -1” 😭

  • @TGH-j2f
    @TGH-j2f 3 місяці тому

    i cant find the touching ground? block

    • @Epikkity
      @Epikkity 26 днів тому

      breo r u dumb

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

    i didn't use your code for the movement so now its all screwed up :(

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

    I cant find the ground in if touching

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

    What is x vel?

  • @Random_Post-bq5ib
    @Random_Post-bq5ib 3 місяці тому

    It doesn’t work
    With gravity

  • @F.U.L13
    @F.U.L13 4 місяці тому

    It was acting a little weird and I don't know why

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

    i cant find the touching ground

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

      Go to sensing and find the 'touching (selection)' block and select whatever your ground is on the selection.

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

      @@BoilingKettle thanks but i already finished my project

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

    I found a glitch in your code i can phase through my wall

  • @TanyaL-f7c
    @TanyaL-f7c 5 місяців тому

    😀😁

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

    E