Bye-bye Raycasting! There's a new kid on the block...
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!
😮
😮
😮
😮
😮
😮
custom movement will be made significantly easier with shape casts. especially sphere casting
yeah i agree, same with footplanting
What does custom movement have to do with shape casting new to raycasting
foot planting checks are needed for procedural foot placement, its a complex topic@@otterryy
How?
Not yet tho they havent added margins so you cant do that
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.
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.
hmmm
@@KupuEIIIKa69 Yea, it's a real thinker :P
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.
@@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.
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.
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!!!
I was doing your course, and I was exactly on the raycasting lecture when this video got on my recommended page😅
My 2024 favorite channel already
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
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.
The Raycasting: 🤫🧏♂
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
i wouldnt say that this will end raycasting but its a nice feature
yeah that was just for the title 😏
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?
You can't parallelize Shapecasts yet :(
Really? Maybe they haven't added functionality for it yet. You can use Spherecast and Blockcast in parallel though!
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
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. 😐
It should be if you use the code NEW_YEAR
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
@@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 🤔
The course was €12, but I think I'll buy the course anyway, but not now
@@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.
Raycasting will still be effective for most things though.
I have used raycasting a lot but i can't think of something to use shapecasting right now
continuous collision detection is what comes to mind for me
Superliminal in Roblox is just around the corner, thanks to DragDetectors and shapecasting
Raycasting would still be more performant. This is just for cases when you need to cast specific shapes.
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.
i remember when they first announced shapecasts
i thought it was cool but i still haven't found a use case for it yet
Shotgun cone is kind of cool!
water simulations on the way!
(I also hope roblox works on their air physics for tornado games)
Never even know this was added, looks pretty cool!
I'm missing "linecasting"... 😂😂😂
dam then i can replace my raycast into shapecast for my railing system, thanks for letting us know for this information
Both in your free and paid courses, could you add Portuguese subtitles? Of course, if the option is available
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.
We got hitboxes let's go
I can imagine uses for Spherecasts and Cubecasts, but not this. Still really cool though!
Wh
rare entertaining roblox youtuber, you've earned a sub
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
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.
"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.
wait, this is actually so cool. It has alot of potential!
finally an easy way to make moving hitboxes a thing
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
Shape casting is extremely expensive. It should be generally avoided and only used occasionally.
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)
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
you shapecast a cone mesh?
no more raycast hitbox
melee games boutta go crazy
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
use the result.Normal i believe
NO MORE MODULES NEEDED!!11!1! 🎉
wait so invisible sharingan!
amazing hitscan attacks will be easier to make
Time to make an AI
LETS FUCKING GOOO
Doesn’t other game engines already have this? For example sherecast in unity
In your Roblox course, do you teach modeling in Blender?
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.
So your course only teaches the lua language, it doesn't teach the rest about Roblox Studios other than programming?
@@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.
Doesn't it teach anyone how to animate?
@@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.
i think this can be useful for procedural walking, right?
love your vids papa fire 🔥
🤨
🤨📷
THIS IS AMAZING
is this the solution that actually is normally done by hash grids?
I still like raycasting more
very nice
very nice indeed
I like raycasting better
I like it
holy shit does this mean raymarching is possible
maybe 🤔
i am making rpg game and this is game changer for mobs attacks and player powers
Hahaha new kid on the BLOCK. Haha smart lmao
waiting for some even better gore games ❤
love u crusher 😸
😸
FINALLY
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
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!
@@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
and just from this video alone i noticed ur clear verbalization of whats going i gotta watch more videos
@@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)
@@crusherfire1 how come u didnt heart my comment
sweet.
I dont make games but this is cool ig
cann someone explain it more, isnt this just part.touched()?
this takes raycastparams and functions like a raycast so theres more things u can do
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.
Picking a game engine boils down to personal preference, ease of use, the learning curve involved, what you're looking to do, and whatnot
Can you publish and host a multiplayer game for thousands of players for free? Nope, but in Roblox you can.
lest go
Kind of a clickbait title. :/
waos
osu
😳 *promo sm*