Introducing Shapecasts

Works great on desktop! Already planning to use this on mobile when the fix is ready.

Most phones (>94%) have this fix now; the rest will be taken care of the next time we force upgrade the mobile app.

2 Likes

Just have the projectile do the shapecast. The magnitude of the direction vector for the shapecast would be the distance the projectile travels per frame.

This actually seems like a pretty useful feature. Thanks, roblox!

Are there any updates on the margins?

5 Likes

Amazing work! And thank goodness it’s out. Great work guys!

Oh my flippin’ goodness. I’ve been staying away from these because I thought it was a Studio Beta. :sweat_smile: Now I can use them in peace, not wondering what would happen on the player side xD

@subcritical - I noticed that :Shapecast came out this week!

Sorry to be annoying but does the release also include margins?

What a glorious day.

Is a certain degree of inaccuracy/inconsistency to be expected when using Spherecast, as can be seen in the following video, or is this a bug?

Video (Streamable link)

To reproduce what’s seen in the video, just use Spherecast to cast a sphere, and move a part around, such that it intersects the cast (and place a part at the position of the RaycastResult so you can visualize the intersection).

2 Likes

It seems to be a bug with spherecast, or it’s something that is not documented.

If there’s a wall close to the spherecast it would literally not detect any hit at all, it doesnt depend on the distance to the wall it just seems to be really specific “dead spots” where it wont detect basically anything, the way I got these spots was by raycasting and reflecting a sphere multiple times

Here’s a video

Here’s a place with one spot I found, the script runs and prints the result (nil)
SpherecastBug.rbxl (86.8 KB)

if it’s not a bug then Im not really sure why this happens

3 Likes

Not sure if it will make a difference since luckily staff has already replied, but feel free to add that to this topic

1 Like

Could we also have Conecast for line of sight?

I noticed on the API documentation, that other than blockcast and spherecast, there is ‘Shapecast’

image

What does this entail and is it released / usable?

It’s been released and you can use it. Allows you to cast a shape represented by a support BasePart, which means you can cast CSG Unions, MeshParts, regular Parts, etc.

What difference does it have with sphere and blockcast? (I.e., performance, efficiency etc)

I assume generalized shapecasts would be slower perfomance wise, compared to sphere and block casts, and i think they both work in a similar way (shapecasts could be just a tiny bit more accurate) so just use block/sphere cast if you plan to use block/sphere mesh cuz the perfomance trade off is not worth it :grin:
could change in the future tho

i feel like they are never gonna add tolerance

well im pretty the performance differance is very small

maybe i should use block cast

Will :Cylindricalcast() be released?

1 Like

Just use a cylinder mesh and Shape casting, should work exactly the same