Bye-bye Raycasting! There's a new kid on the block...

Sdílet
Vložit
  • čas přidán 9. 09. 2024
  • Raycasting is a common tool used by Roblox developers all of the time for collision detection. But raycasting can't solve all of our issues for certain scenarios. This is where generalized shape casting can come into play!
    Ever wanted to learn Roblox Studio & scripting? Check out my course:
    bit.ly/LuaScri...
    Use code RBLX_DEV for 33% off!
    My linktree:
    linktr.ee/crus...
    Happy scripting!

Komentáře • 185

  • @Iegendarystudio
    @Iegendarystudio Před 7 měsíci +101

    😮

  • @sicknickeroni
    @sicknickeroni Před 7 měsíci +116

    custom movement will be made significantly easier with shape casts. especially sphere casting

    • @frazomania
      @frazomania Před 7 měsíci +2

      yeah i agree, same with footplanting

    • @otterryy
      @otterryy Před 7 měsíci +1

      What does custom movement have to do with shape casting new to raycasting

    • @frazomania
      @frazomania Před 7 měsíci

      foot planting checks are needed for procedural foot placement, its a complex topic@@otterryy

    • @calumwoodward9489
      @calumwoodward9489 Před 7 měsíci +1

      How?

    • @nerforangeman
      @nerforangeman Před 7 měsíci +1

      Not yet tho they havent added margins so you cant do that

  • @Wokrezv
    @Wokrezv Před 7 měsíci +17

    I imagine that this system could be utilized for shadow-based puzzles, like to the ones seen in games like Resident Evil, where ordinary figures transform into exotic shadows, adding complexity and intrigue to the gameplay. That will be pretty cool.

  • @Andrew90046zero
    @Andrew90046zero Před 7 měsíci +38

    I always found shape-casting fascinating, but I also assume it's way (a ton more) slower than raycasting, so I don't often use it (even outside of Roblox). Though, that could be because I haven't had a good scenario for it yet.
    But the assumptions I've had about how shapecasts work are probably wrong.
    In reality, what is essentially happening is, you are getting a 2D profile of the 3d object in the direction you are going to cast. And essentially producing a volume based on that 2D profile. So it's essentially extruding out the 2D shape. Then it just checks to see what objects overlap the volume, and then finds the first overlap, and then finds the first point of intersection.
    At least, that's my generall idea on how it works! But that would make it very similar in performance compared to just any other object doing it's own collision checking.

    • @KupuEIIIKa69
      @KupuEIIIKa69 Před 7 měsíci +2

      hmmm

    • @Andrew90046zero
      @Andrew90046zero Před 7 měsíci +2

      @@KupuEIIIKa69 Yea, it's a real thinker :P

    • @galacticdragon9841
      @galacticdragon9841 Před 7 měsíci +3

      as you said, it is probably as expensive as an unanchored parts collision detection so my guess is, if it’s only being done like 10-20 times per frame for like ik movement, it should be fine, although in that case you would probably use sphere casts and those are cheaper than shape casts. Idk what shape casts would be good for except for maybe vehicle movement and some cone shaped detection.

    • @Andrew90046zero
      @Andrew90046zero Před 7 měsíci +1

      @@galacticdragon9841 Yea, now that you mention doing a shape cast with somthing like a cone.
      It makes me wonder how that would work.
      If you took a cone mesh, and then shape casted it in the direction the cone is pointing.
      Would the hit point depend on the shape. So like, because of the cone's slant, it would hit the side of the cone rather than the tip.
      It's hard to describe without a visual, but hopefully you know what I mean.

  • @TweakinOnColeslaw
    @TweakinOnColeslaw Před 6 měsíci +4

    I can easily see this being used to make a Tetris like shape-cast, like showing where the shapes are going to land and how they will fit.

  • @EliseyzScripts
    @EliseyzScripts Před 3 měsíci +2

    Thank you so much!! I'm so happy i clicked on this video a couple weeks back... It has made scripting physical stuff so much easier!! Thank you so much again!!!

  • @j1mp958
    @j1mp958 Před 6 dny

    I was doing your course, and I was exactly on the raycasting lecture when this video got on my recommended page😅

  • @adham-cw5md
    @adham-cw5md Před 7 měsíci +6

    My 2024 favorite channel already

  • @CrypticRealChannel
    @CrypticRealChannel Před 7 měsíci +3

    anyways bro, thanks for the volume thing, i dont know how to script and that thing you teach was a life saving for my detail environments builds

  • @MolezaX
    @MolezaX Před 3 měsíci +1

    I believe thas is perfect for games that like the''Tools'' in-game that makes free Building moment, just turn that function On client-side.
    then after the player ''confirms to place that part on the selected area'' just fire a remote so the server can confirm it and broadcast to all players.

  • @anko6567
    @anko6567 Před 7 měsíci +4

    The Raycasting: 🤫🧏‍♂

  • @BLUYES422
    @BLUYES422 Před 7 měsíci +2

    would be coool to see what a terrain would look like if you used a torus shape cast in place of like a ray cast system

  • @p4ncake_s
    @p4ncake_s Před 7 měsíci +2

    i wouldnt say that this will end raycasting but its a nice feature

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +2

      yeah that was just for the title 😏

  • @shooterdefronvrps2
    @shooterdefronvrps2 Před 7 měsíci +1

    With this instead of Makin a sphere translate you could scale it
    Like a small sphere cast for a missile to know if a missile hit something and another that scale till a max range and know where is and isn't on blast radius?

  • @SyntaxMenace
    @SyntaxMenace Před 7 měsíci +3

    You can't parallelize Shapecasts yet :(

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +1

      Really? Maybe they haven't added functionality for it yet. You can use Spherecast and Blockcast in parallel though!

  • @BRACERFENIX
    @BRACERFENIX Před 7 měsíci

    This would be awesome for pathfinding and so many other things. You could find obstacles based on their shape rather than having to fire multiple rays

  • @s1lva442
    @s1lva442 Před 7 měsíci +3

    I've been eyeing your Roblox course for days, even just a few hours ago the course was on discounted. Now that I finally decide to buy it, the course is no longer discounted. 😐

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +3

      It should be if you use the code NEW_YEAR

    • @s1lva442
      @s1lva442 Před 7 měsíci +1

      This code only gives a 30% discount, and less than 24 hours ago it was 85% off, with this price I can opt for another course that offers the same quality but has a bigger discount, I really wanted to buy your courses that I was waiting for days, I'm sorry

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +1

      ​@@s1lva442 My course isn't enrolled in what they call their "Deals Program".
      In fact, if my course was "85% off", it would be 7 dollars. Udemy does not price courses that low, I think you might've been looking at a different course.
      Almost every other week Udemy keeps marketing their "sales" which is literally just taking courses in the program and plunging their price down to around 10-16 dollars, and Udemy still takes a 63% cut from that. If you wanna buy those other ones, go ahead! I don't control your money and you don't need to apologize.
      Maybe I should also migrate to Teachable 🤔

    • @s1lva442
      @s1lva442 Před 7 měsíci

      The course was €12, but I think I'll buy the course anyway, but not now

    • @crusherfire1
      @crusherfire1  Před 7 měsíci

      @@s1lva442
      "The course was €12"
      My course was €12? I'm not sure how that would be possible since I'm not enrolled in their 'deals' program.

  • @k-a-t_21
    @k-a-t_21 Před měsícem

    Raycasting will still be effective for most things though.

  • @issy4897uwu
    @issy4897uwu Před 7 měsíci +1

    I have used raycasting a lot but i can't think of something to use shapecasting right now

    • @vibaj16
      @vibaj16 Před 7 měsíci

      continuous collision detection is what comes to mind for me

  • @trinitrotoluene3D
    @trinitrotoluene3D Před 5 měsíci

    Superliminal in Roblox is just around the corner, thanks to DragDetectors and shapecasting

  • @Vortex-qb2se
    @Vortex-qb2se Před 7 měsíci +5

    Raycasting would still be more performant. This is just for cases when you need to cast specific shapes.

    • @tozpeak
      @tozpeak Před 7 měsíci +2

      This. Rays for massive performance, shapes for accuracy.
      Spherecasts should be nice as a separate cathegory inbetween, since, there should be nice optimized math solutions for this. Sphere moved across the line is a capsule.

  • @danibanani15
    @danibanani15 Před 6 měsíci

    i remember when they first announced shapecasts
    i thought it was cool but i still haven't found a use case for it yet

  • @Smurfis
    @Smurfis Před 2 měsíci

    Shotgun cone is kind of cool!

  • @theofficiaIsteve
    @theofficiaIsteve Před 6 měsíci

    water simulations on the way!
    (I also hope roblox works on their air physics for tornado games)

  • @ElmoPlayss
    @ElmoPlayss Před 7 měsíci

    Never even know this was added, looks pretty cool!

  • @lucasvitos
    @lucasvitos Před 4 měsíci

    I'm missing "linecasting"... 😂😂😂

  • @ps_lol
    @ps_lol Před 7 měsíci

    dam then i can replace my raycast into shapecast for my railing system, thanks for letting us know for this information

  • @s1lva442
    @s1lva442 Před 7 měsíci +1

    Both in your free and paid courses, could you add Portuguese subtitles? Of course, if the option is available

    • @crusherfire1
      @crusherfire1  Před 7 měsíci

      Yes, I can add captions, though I will need to download the auto-generated captions in English and translate them into other languages as Udemy does not auto-translate, so that may take some time.

  • @davidossantos9908
    @davidossantos9908 Před 6 měsíci

    We got hitboxes let's go

  • @cody-meow
    @cody-meow Před 7 měsíci

    I can imagine uses for Spherecasts and Cubecasts, but not this. Still really cool though!

  • @ReconnectRyan
    @ReconnectRyan Před 7 měsíci

    rare entertaining roblox youtuber, you've earned a sub

  • @Smurfis
    @Smurfis Před 2 měsíci

    Could you have a look at this with CSG and show case it possibly even use Region3 and showcase some new features like editing terrain

  • @starflarestudios
    @starflarestudios Před 7 měsíci +1

    This is a very useful feature for projectile based systems, and suspension systems in say cars, although I don’t believe this will end the need for raycast due to the lack of a couple features for logical reasons, one being the inability to get the normal of the collisions part below to rotate the part to match it.

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +2

      "inability to get the normal of the collisions part below to rotate the part to match it."
      The shape casting functions return a RaycastResult, which includes the normal of the face that was collided with.

  • @heppecogheron6016
    @heppecogheron6016 Před 7 měsíci

    wait, this is actually so cool. It has alot of potential!

  • @ixylovespies
    @ixylovespies Před 7 měsíci

    finally an easy way to make moving hitboxes a thing

  • @kibbet2276
    @kibbet2276 Před 7 měsíci

    this does not really replace raycasting, still needed for different things, also this is quite expensive on memory and there has always been custom way more efficient ones

  • @thegoldenatlas753
    @thegoldenatlas753 Před 7 měsíci

    Shape casting is extremely expensive. It should be generally avoided and only used occasionally.

    • @crusherfire1
      @crusherfire1  Před 7 měsíci

      You can use it in conjunction with Parallel Luau just like normal Raycasts to improve frame times if you need to use it more frequently! (though, yes, it is more expensive than regular raycasting)

  • @nervehammer1
    @nervehammer1 Před 7 měsíci +2

    Woah, now that you mentionee making a viewcone for ai using shape casting, im really interested, since im making a horror game and working on ai that cant hear you but can see you.
    How would it work though? I'm pretty confused

  • @reygenne1
    @reygenne1 Před 7 měsíci

    no more raycast hitbox

  • @lossycompressed
    @lossycompressed Před 7 měsíci

    melee games boutta go crazy

  • @Spooky.Studios
    @Spooky.Studios Před 7 měsíci +1

    uhh so how can i calculate the orientation for the shapecast part to match the surface it's on? for example if we get it on a wedge i want the shapecast part angled to be perfectly level with the same angle the wedge's surface is

    • @ruaridh6744
      @ruaridh6744 Před měsícem

      use the result.Normal i believe

  • @renites7672
    @renites7672 Před 7 měsíci

    NO MORE MODULES NEEDED!!11!1! 🎉

  • @zubedube
    @zubedube Před 7 měsíci

    wait so invisible sharingan!

  • @fatalstupidanimator1410
    @fatalstupidanimator1410 Před 7 měsíci

    amazing hitscan attacks will be easier to make

  • @Sopharette
    @Sopharette Před 7 měsíci +1

  • @jamesknight0001
    @jamesknight0001 Před 7 měsíci

    Time to make an AI

  • @dadogwitdabignose
    @dadogwitdabignose Před 6 měsíci

    LETS FUCKING GOOO

  • @warsin8641
    @warsin8641 Před 7 měsíci

    Doesn’t other game engines already have this? For example sherecast in unity

  • @s1lva442
    @s1lva442 Před 7 měsíci +1

    In your Roblox course, do you teach modeling in Blender?

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +1

      No, I don't teach Blender modeling, as many great courses on Udemy or even thousands of free videos on CZcams will teach you everything you need to learn about Blender.
      I am no Blender expert, so it's best to leave that to the professionals! My course focuses completely on scripting. 3D modeling is a whole other ball game.

    • @s1lva442
      @s1lva442 Před 7 měsíci +1

      So your course only teaches the lua language, it doesn't teach the rest about Roblox Studios other than programming?

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +1

      @@s1lva442
      Not 'only lua', but we learn the Luau programming language, how to use Studio, & the Roblox API, which is everything you need to start creating games. We take a look at many services within the Roblox API, data types, instances, etc.
      If you want to learn about 3D modeling, there are many other great courses that specialize in that field. My course is geared towards everything scripting & Roblox API-related.

    • @s1lva442
      @s1lva442 Před 7 měsíci

      Doesn't it teach anyone how to animate?

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +1

      @@s1lva442 Yes, it'll take a look at how to use the built-in Roblox animation editor and also how to implement animations in scripts.

  • @Ashdraj
    @Ashdraj Před 7 měsíci

    i think this can be useful for procedural walking, right?

  • @zenonPTS
    @zenonPTS Před 7 měsíci +1

    love your vids papa fire 🔥

  • @rhexicon
    @rhexicon Před 7 měsíci

    THIS IS AMAZING

  • @dundavey
    @dundavey Před 7 měsíci

    is this the solution that actually is normally done by hash grids?

  • @vrfrenzy8451
    @vrfrenzy8451 Před 7 měsíci

    I still like raycasting more

  • @acelaox6836
    @acelaox6836 Před 7 měsíci

    very nice

  • @suezq74
    @suezq74 Před 2 měsíci

    I like raycasting better

  • @sti12007
    @sti12007 Před měsícem

    I like it

  • @MINECRAFTLOVER4000
    @MINECRAFTLOVER4000 Před 7 měsíci

    holy shit does this mean raymarching is possible

  • @__czarekk__
    @__czarekk__ Před 7 měsíci

    i am making rpg game and this is game changer for mobs attacks and player powers

  • @Chlrintruc
    @Chlrintruc Před 7 měsíci

    Hahaha new kid on the BLOCK. Haha smart lmao

  • @Heroi_Brasileiro
    @Heroi_Brasileiro Před 7 měsíci

    waiting for some even better gore games ❤

  • @ziepex7009
    @ziepex7009 Před 7 měsíci

    love u crusher 😸

  • @Skyfear89
    @Skyfear89 Před 7 měsíci

    FINALLY

  • @otterryy
    @otterryy Před 7 měsíci

    I've been a good boy with spending my money online I never once bought a course but u might be the exception. The only thing that's stopping me right know is not know how you will explain concepts. I'm against copy paste code or reciting what you're about to write like that explains what it means. Chat gpt is a good example of someone who can explain a concept easily and consistently. Only problem is it can be wrong somtiems and its not updated with the api. If you can explain concepts the way I Like them explained I'm down. Could you explain how u describe them? And what makes ur course different from other courses

    • @crusherfire1
      @crusherfire1  Před 7 měsíci

      I ensure to explain the code I am writing so you understand what is happening without just copying mindlessly. My goal isn't to get you trapped in tutorial hell, but instead, to give you a skillset you can use to make games.
      Virtually all other courses teach you how to make very basic and boring games like obbies, simulators, etc.
      However, we work on several projects together including two games that you can view in the course previews (that are NOT simulator or obby games). The best way I can describe how I explain the code is by literally just walking through the code and thinking logically about how the interpreter is going to execute the code.
      You'll also be able to join the private discord server, and if you ever need help with a concept, or you've run into a scripting issue, you can make a forum post in the discord and I'll be able to assist you as soon as possible. (always ask questions!)
      I'm not aware if other courses have communities within discord.
      You'll also have access to all the materials for the projects, all code used in the course, and additional resources like my cheat sheet to help you remember programming phrases and jargon.
      Anyways, that's just my little spiel, I recommend that you continue looking around and seeing what course or resources are the right fit for you.
      If you've decided on mine (thanks!), then you can use the code in the description for a discount!

    • @otterryy
      @otterryy Před 7 měsíci

      @@crusherfire1 the fact u responded like this pushing me towards it ill think about it in the future when i get deeper in scripting. ive noticed while getting familiar with coding there are annoying gaps in my knowledge that shouldnt even exist which is y im considering a course. taking courses in college but the professor straight up tells us to copy and paste the code. will def consider this investment

    • @otterryy
      @otterryy Před 7 měsíci

      and just from this video alone i noticed ur clear verbalization of whats going i gotta watch more videos

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +1

      @@otterryy
      Also want to mention that the microphone I'm using in the course was my older one (just got this new one a couple weeks ago), so if that's a concern you can, of course, watch the free preview videos to see if that's going to be an issue for you (hopefully not lol)

    • @otterryy
      @otterryy Před 7 měsíci

      @@crusherfire1 how come u didnt heart my comment

  • @truecrusadeer
    @truecrusadeer Před 7 měsíci

    sweet.
    I dont make games but this is cool ig

  • @luxky
    @luxky Před 7 měsíci

    cann someone explain it more, isnt this just part.touched()?

    • @a_username_lol
      @a_username_lol Před 7 měsíci

      this takes raycastparams and functions like a raycast so theres more things u can do

  • @BetaTester704
    @BetaTester704 Před 7 měsíci

    I dont really get the appeal of making games for Roblox, you can do everything better in dedicated game engines like Godot, Unity, or Unreal engine.

    • @crusherfire1
      @crusherfire1  Před 7 měsíci +3

      Picking a game engine boils down to personal preference, ease of use, the learning curve involved, what you're looking to do, and whatnot

    • @RenanMsV_YT
      @RenanMsV_YT Před 7 měsíci +5

      Can you publish and host a multiplayer game for thousands of players for free? Nope, but in Roblox you can.

  • @kontoarbuzowe6144
    @kontoarbuzowe6144 Před 7 měsíci

    lest go

  • @somenerd8139
    @somenerd8139 Před 2 měsíci +1

    Kind of a clickbait title. :/

  • @HeldByStrings
    @HeldByStrings Před 7 měsíci

    waos

  • @Anarqism
    @Anarqism Před 6 měsíci

    osu

  • @herbertbroady126
    @herbertbroady126 Před 6 měsíci

    😳 *promo sm*