Collisions in Scratch - The EASY WAY

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • Although there are many tutorials on this subject, this tutorial will help you if they are a bit too challenging for you. Enjoy the video.
    Click this link, or Gobo will destroy your family. / @bigfatsnakeviiper
    More than 99% of crimes happen to people not subscribed to this channel. So, to protect yourself and your loved ones, consider subscribing.
    Liked this video? Check this out next: Making a Game - The Way Scratch Team Intended: • Making a Game the Way ...
    #scratch #coding #game #gamedev #easy #simple #viiperrr #smooth #smoothmovement #movement #scratchgames #scratchprogramming #programming #development #scratchcat #fast #quick #arrowkeys #motioneffects #scratchprojects #codingtips #gamedevelopment #tutorial #codingforbeginners #moving #motioneffects #quick #fast #scratchgames #theeasiestwaytomakeaplatformeronscratch #howtomakesmoothmovementinscratch #easiestway #theeasyway #easyway #colisions #colide #colider #walls #ground #stopgoingintowalls #stopgoingintotheground #stopplayer #touchingwall

Комментарии • 193

  • @AFellowObjectShowFan
    @AFellowObjectShowFan 10 месяцев назад +26

    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.

  • @bigfatsnakeviiper
    @bigfatsnakeviiper  11 месяцев назад +18

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

    • @Aetherpixl
      @Aetherpixl 11 месяцев назад +6

      An easier way to do this is to make a player collision box, and if the player is touching an object like a wall, make the player go to the box.

    • @Aetherpixl
      @Aetherpixl 11 месяцев назад +5

      If you try to move up and down it doesn't work though, so for that we could use your code and save a little time.

    • @meowmeow6743
      @meowmeow6743 10 месяцев назад +3

      gravity/jumping please

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  10 месяцев назад +5

      @@meowmeow6743 I've actually already done that in this video: Simple Jumping Physics in Under a Minute
      ruclips.net/video/rk5iz8XFMpw/видео.html

    • @profiley.
      @profiley. 10 месяцев назад +3

      Clicker game please

  • @TheSnazzy
    @TheSnazzy 10 месяцев назад +6

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

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  10 месяцев назад +2

      Thank you!

    • @ArtscoStudioShorts
      @ArtscoStudioShorts 9 месяцев назад

      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  9 месяцев назад

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

    • @ArtscoStudioShorts
      @ArtscoStudioShorts 9 месяцев назад

      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

  • @abel.studios.17
    @abel.studios.17 9 месяцев назад +5

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

  • @Elfeen
    @Elfeen 10 месяцев назад +4

    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!

  • @AssassinatingFamousPeople
    @AssassinatingFamousPeople 7 месяцев назад +5

    Thanks, although I am quite an experienced scratcher ( 3.4 years ) this helped a lot as I have forgotten to set the speed to 0 afterwards and therefore had the bounce effect continue in tight spaces. This really helped! Thank you. ( Btw I did discover the same smooth movement method as yours quite a bit before that video came out, however I have never gotten collisions to work.

  • @AFellowObjectShowFan
    @AFellowObjectShowFan 10 месяцев назад +4

    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.

  • @KRXZY_rektt
    @KRXZY_rektt 10 месяцев назад +3

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

  • @juliocesarcamilo5132
    @juliocesarcamilo5132 6 месяцев назад

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

  • @DragonsAreCoolScratch
    @DragonsAreCoolScratch 10 месяцев назад +4

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

  • @HopeReviews
    @HopeReviews 8 месяцев назад

    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.

  • @Hypernova386
    @Hypernova386 11 месяцев назад +4

    editing skills 11/10 keep it up :)

  • @dogoz_edits
    @dogoz_edits 10 месяцев назад +3

    im not a scratch developer but i like watching this channel

  • @JJWarriorBlade
    @JJWarriorBlade 6 месяцев назад +2

    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 😂

  • @islemgaming201
    @islemgaming201 10 месяцев назад +3

    You got a new subscriber :D

  • @ImIntrestedInBreadWinners
    @ImIntrestedInBreadWinners 7 месяцев назад

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

  • @kleb-wants-subs
    @kleb-wants-subs 9 месяцев назад +9

    Bros whiskers are rock solid 2:07

  • @TotallyNotHetsuko
    @TotallyNotHetsuko 6 месяцев назад

    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.

  • @njjc521
    @njjc521 11 месяцев назад +4

    Good topic. Good explanation 😊😊

    • @Aetherpixl
      @Aetherpixl 11 месяцев назад +3

      Agreed. Great vid!

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  11 месяцев назад +3

      Thanks

    • @Aetherpixl
      @Aetherpixl 11 месяцев назад +2

      @@bigfatsnakeviiper no problem! You explained this very well!

  • @cosmocode75
    @cosmocode75 10 месяцев назад +3

    Also it can be 0 - x vel

  • @sonicroboblast2fan833
    @sonicroboblast2fan833 11 месяцев назад +3

    Wow!Great Job!🎉🎉😊.

  • @gulrajmrokofficial
    @gulrajmrokofficial 4 месяца назад

    bros the reason good job exists

  • @scratchtutorials-nf9zq
    @scratchtutorials-nf9zq 10 месяцев назад +3

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

  • @j1studio-oz5hc
    @j1studio-oz5hc 11 месяцев назад +4

    What time do you upload

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  11 месяцев назад +2

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

  • @SadBacon139
    @SadBacon139 3 месяца назад

    W I love ur channel keep it up mate!

  • @M1auus
    @M1auus 5 месяцев назад

    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

  • @billy54441
    @billy54441 10 месяцев назад +3

    I did that and that didnt work i used offline editor

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  10 месяцев назад +2

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

    • @billy54441
      @billy54441 10 месяцев назад +2

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

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  10 месяцев назад +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?

  • @AndrewPlayedThis-jv9zz
    @AndrewPlayedThis-jv9zz 7 месяцев назад

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

  • @ChocolateOSOfficial
    @ChocolateOSOfficial 5 месяцев назад

    Helps me with my TWHG Testing project.

  • @misterflint15
    @misterflint15 10 месяцев назад +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

  • @gamerboyfadi3870
    @gamerboyfadi3870 11 месяцев назад +4

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

  • @dogoz_edits
    @dogoz_edits 10 месяцев назад +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  10 месяцев назад +3

      I will keep that in mind.

    • @juliocesarcamilo5132
      @juliocesarcamilo5132 6 месяцев назад

      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

  • @morganisapro7K
    @morganisapro7K 3 месяца назад +1

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

  • @PPurps
    @PPurps 9 месяцев назад +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  9 месяцев назад +3

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

    • @PPurps
      @PPurps 9 месяцев назад +3

      @@bigfatsnakeviiper thank you ❤️

  • @Spectrqlz
    @Spectrqlz 11 месяцев назад +3

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

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  11 месяцев назад +2

      I've actually already done that in this video: Simple Jumping Physics in Under a Minute
      ruclips.net/video/rk5iz8XFMpw/видео.html

    • @Spectrqlz
      @Spectrqlz 11 месяцев назад +2

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

  • @BrandonTheOne2
    @BrandonTheOne2 4 месяца назад +1

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

  • @ElementalsAnimations
    @ElementalsAnimations 3 месяца назад

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

  • @danni_gacha0
    @danni_gacha0 5 месяцев назад +2

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

  • @solomonimie7821
    @solomonimie7821 7 месяцев назад +3

    viperr > khan academy

  • @Ocean10230
    @Ocean10230 10 месяцев назад +5

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

    • @eason9
      @eason9 9 месяцев назад +1

      same

  • @guraleracaj4911
    @guraleracaj4911 6 месяцев назад

    Thanks man! Its really helpfull

  • @radvin23
    @radvin23 6 месяцев назад

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

  • @meinevideosmp4
    @meinevideosmp4 4 месяца назад

    Thanks man that helped a lot. Like and Sub

  • @freddyfazbearplushee
    @freddyfazbearplushee 6 месяцев назад

    2:17 he go into da backrooms

  • @LuluEdits6555
    @LuluEdits6555 4 месяца назад +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 4 месяца назад +1

      Nvm I was just being dumb :D

  • @sirborkyes
    @sirborkyes 5 месяцев назад

    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?

  • @ninicofeio
    @ninicofeio 7 дней назад

    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

  • @XoGamer176
    @XoGamer176 5 месяцев назад

    this help TYSM!

  • @kannibuskid122
    @kannibuskid122 2 месяца назад

    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?

  • @MiniConDog
    @MiniConDog 3 месяца назад +1

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

  • @chocolate_Bear248
    @chocolate_Bear248 2 месяца назад

    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)

  • @Silyum222
    @Silyum222 4 месяца назад

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

  • @MonkesClayhut
    @MonkesClayhut 2 месяца назад

    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?

  • @NickySunny
    @NickySunny 2 месяца назад

    cant see x vel

  • @yahiaschaoticnumberblocks
    @yahiaschaoticnumberblocks 22 дня назад

    Coming soon.. Collisions in Scratch - The HARD WAY

  • @TGH-j2f
    @TGH-j2f Месяц назад

    i cant find the touching ground? block

  • @iamkloketo5069
    @iamkloketo5069 8 месяцев назад

    great!

  • @natbia5362
    @natbia5362 4 месяца назад

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

  • @MaximchikPlayz
    @MaximchikPlayz 3 месяца назад

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

  • @Edltor87
    @Edltor87 5 месяцев назад +1

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

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  5 месяцев назад

      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 5 месяцев назад

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

  • @_GlobeTrekker_
    @_GlobeTrekker_ 10 месяцев назад +2

    Just subed

  • @hirjinjiemoe-vx3mr
    @hirjinjiemoe-vx3mr 19 дней назад

    Does this works for scrolling game?

  • @johndesacada9893
    @johndesacada9893 10 месяцев назад +2

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

  • @DannyDanhNguyen
    @DannyDanhNguyen 5 месяцев назад

    thanks

  • @marielamb-doyle654
    @marielamb-doyle654 4 месяца назад

    How do we make Controls
    for mobile

  • @томни
    @томни 10 месяцев назад +2

    Collision chain

  • @Banana_Berry_Bandit
    @Banana_Berry_Bandit 4 месяца назад

    it dosent work bc my sprite follows the mouse pointer

  • @bilbil03040
    @bilbil03040 3 месяца назад

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

  • @BeckReckz
    @BeckReckz 6 месяцев назад

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

  • @littleinteriors
    @littleinteriors 7 месяцев назад

    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  7 месяцев назад

      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 7 месяцев назад

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

  • @Random_Post-bq5ib
    @Random_Post-bq5ib Месяц назад

    It doesn’t work
    With gravity

  • @bario.
    @bario. 9 месяцев назад +2

    "easy way"

  • @zenvador
    @zenvador 6 месяцев назад

    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 6 месяцев назад

      Thank you very very much

  • @spideysuckatlife1751
    @spideysuckatlife1751 6 месяцев назад

    I cant find the ground in if touching

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  6 месяцев назад

      You need to male a new ground sprite for that.

  • @Thatcoolpersonjoel
    @Thatcoolpersonjoel 4 месяца назад

    Where do i find the x vel block

  • @Snowyquy
    @Snowyquy 11 месяцев назад +1

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

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  11 месяцев назад +2

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

  • @reinplayzboiii5840
    @reinplayzboiii5840 6 месяцев назад

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

  • @hamster_reformed_reborn
    @hamster_reformed_reborn 8 месяцев назад +1

    W

  • @Konstini
    @Konstini 6 месяцев назад +1

    x vel in german???

    • @savio3859
      @savio3859 5 месяцев назад

      x Geschwindigkeit (x gesch) im guessing

  • @F.U.L13
    @F.U.L13 2 месяца назад

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

  • @TheEpicCahakakak
    @TheEpicCahakakak 8 месяцев назад

    i cant find the touching ground

    • @certifiedbfdifan
      @certifiedbfdifan 7 месяцев назад

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

    • @TheEpicCahakakak
      @TheEpicCahakakak 7 месяцев назад

      @@certifiedbfdifan thanks but i already finished my project

  • @DzordzmajkelGD
    @DzordzmajkelGD 6 месяцев назад

    What is x vel?

  • @inaeythorsdottir9426
    @inaeythorsdottir9426 9 месяцев назад +2

    I use a simpler way then that

  • @diegotalksmonke
    @diegotalksmonke 10 месяцев назад +3

    IM EARLY!

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  10 месяцев назад +2

      You are lol

    • @diegotalksmonke
      @diegotalksmonke 10 месяцев назад +3

      @@bigfatsnakeviiper how did you make your channel grow so fast?

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  10 месяцев назад +3

      @@diegotalksmonke It didn't grow that fast lol. I just devoted a lot of my time into this channel.

  • @long_bow2
    @long_bow2 7 месяцев назад

    why is it not working

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  7 месяцев назад

      How did it break? What happens when you try to move around and bump into walls?

    • @long_bow2
      @long_bow2 7 месяцев назад

      I figured out i just made a mistake@@bigfatsnakeviiper

    • @long_bow2
      @long_bow2 7 месяцев назад

      i realized i just made a mistake@@bigfatsnakeviiper

  • @Giraffe-kids
    @Giraffe-kids 4 месяца назад

    Doesn’t work

    • @lexiryan3259
      @lexiryan3259 3 месяца назад

      Well it worked for me...

  • @mikevazovsky2532
    @mikevazovsky2532 11 месяцев назад +2

    I think I know a easier way

    • @bigfatsnakeviiper
      @bigfatsnakeviiper  10 месяцев назад +1

      What would that be?

    • @mikevazovsky2532
      @mikevazovsky2532 10 месяцев назад +1

      Move 1 step in direction you want and if touching wall move -1 step

    • @mikevazovsky2532
      @mikevazovsky2532 10 месяцев назад +1

      @@bigfatsnakeviiper also about terraria unfinished version, If you want I can sent you the link to scratch profile.

  • @TanyaL-f7c
    @TanyaL-f7c 3 месяца назад

    😀😁

  • @elenahliopoulou89
    @elenahliopoulou89 7 месяцев назад

    2 Is Too Slow

  • @Chicken8097
    @Chicken8097 Месяц назад

    it did not work )=

  • @ScratchProgrammingYT
    @ScratchProgrammingYT 4 месяца назад

    doesent work

  • @orange123-z5f
    @orange123-z5f 7 месяцев назад

    theres a problem the upper collisions make my cat go up even faster instead of stopping it

  • @viniciuslopesfabricio1876
    @viniciuslopesfabricio1876 9 месяцев назад +1

    E

  • @YAHYATrkhn
    @YAHYATrkhn 3 месяца назад

    🤫🧏

  • @Yoggi_71
    @Yoggi_71 8 месяцев назад

    I know simpler

  • @PleaseDontLeaveMeHangingReply
    @PleaseDontLeaveMeHangingReply 4 месяца назад

    How to scroll