Introducing generalized shapecasts

This topic was automatically opened after 10 minutes.

I can’t wait to start using this, it brings lots of potential! Is there any plans for more features like this in the future?

53 Likes

Thank you for this!
Finally, we can easily make differently shaped hitboxes (for melee and projectiles).

And yes, it would be very nice indeed to have an option for a CFrame override so that the part can be used in multiple locations without having to move it manually (via code).


I do have one question in mind, can we re-use the same part for multiple casts in different locations with the overide feature?
38 Likes

Seems useful for something like a building system or item drop system. A great addition to the Roblox engine. Can’t wait to see further improvements in the future :+1:

37 Likes

Sounds really good. Finally can use something that can help me with all instances.

Question though, will this not potentially remove Blockcast and Spherecast or set as deprecated?

30 Likes

Awesome. Were the return types fixed though?

29 Likes

Blockcast and Spherecast will live on for when you don’t have a part to cast from.

37 Likes

Could someone give me an example where I’d wanna use this?

24 Likes

Thank you, we’ll get this fixed!

27 Likes

Awesome! Is this possible to use with unions?

20 Likes

This is stated in the post. Unions are part of the CSG system, so yes.

21 Likes

Could use it for an accurate melee system, where the blade of the sword is cast in the direction of the swing, to see if it hit anything

23 Likes

Now this is quite nice to see. What else are we expecting in the future regarding shapecasts aside from the ones mentioned?

18 Likes

Sounds amazing! Does this support EditableMeshes? If not, I think that should be a crucial feature since lots of us are planning on using them as much as possible. It would also make custom physics engines much more efficient since the collision logic wouldn’t be in Luau.

21 Likes

Due to the nature of the way shapecasts work. I’m guessing a cone cast is still relevent because a shapecast will make a cone shaped mesh look more like a cylinder if the direction value is used accordingly. If anyone can correct me on this that’d be helpful.

It just would be nice to have a fast method for detecting if something is within “view” of say another object, like an NPC, or a targetting system.

17 Likes

Uh so the shapecasts ignore the precise convex decomposition property of mesh and unions, it will always use the default collision, and it’s kinda annoying for projectiles, will this ever be fixed?

18 Likes

PLEASE add visualisations for raycasts for developer debugging reasons! It’s super inconvenient trying to check to see if our raycasts are being done in the correct manner.

87 Likes

Does WorldRoot:GetPartsInPart() supersede WorldRoot:GetPartBoundsInBox()?

No… alright, so no.

17 Likes

They use whatever the current decomposition geometry is. Precise mode should work - can you provide a repro?

18 Likes

You can use existing Gizmo libraries to achieve the same effect, this is the one I use:

18 Likes