The minimum size is (0, 0, 0).
A change is already in-flight to fix that code example.
So all parts are detected then? To quote the post:
Except (0,0,0) is impossible, as the minimum is (0.001,0.001,0.001)
finally bro sized raycasts
Absolutely wonderful! I’ve been waiting for this for quite some time. This will serve as an easier and more efficient way to handle splash damage!
Also, are the visualizers built in-house as a beta/Studio setting or was it handmade? Would love to use the visualizers to help debug shapecasts.
Pretty neat feature overall, although I do have a suggestion.
May it be possible to add a parameter in which you can specify an angle to spread the cast like the setting on a surface light instance would do?
“* Fast-moving projectiles: Raycasts are fine for small projectiles like bullets, but the movement of larger missiles with volume can’t be accurately modeled with rays.”
a little off topic but would it be possible to add a delay to rays? if we have a projectile system that uses non instant projectiles and we wanted to use raycasting, could we make to where a ray “travels” a distance slowly rather than instantly? this would eliminate the need to make moving hitboxes.
While I would love this as well if it were implemented, I think it’s too non-performant and niche to be implemented
Tried seeing the performance difference by directly swapping raycast with spherecast in my parallelized projectile framework
Conclusion: no noticeable difference with a spherecast radius of 1, CFraming the projectiles is still the main bottleneck lol
This is very nice, i’ve been trying to get a good way of doing melee hitboxes for a long time, this will serve the purpose perfectly, not only that but really does make it easier to address a lot of other issues that previously had to be handled with normal raycasts, are there plans on supporting other shapes in the foreseeable future?
if so, wouldn’t it be better to have it as
WorldRoot:ShapeCast(
shape: ShapecastShape
cf: CFrame,
size: Vector3,
direction: Vector3,
params: RaycastParams?
): RaycastResult?
(shape argument)
instead of separating it in two different functions?
Some shapes are pretty niche and would need their own unique parameters for defining them. Sphere uses radius which is a number, box uses size which is a Vector3, pill would need radius and maybe two extra vectors to define its dimensions and orientation (?)
It would be hard to polymorphize a singleton “Shapecast” function to suit all of them, so I think it would be better to make each type of shapecast its own individual method
are you using bulkMoveTo here?
I was messing around with studio earlier and I saw these methods! You have no idea how excited I was to see this! ^^
Infinitesimally? Really? Didn’t know 0.001 could be called infinitesimal.
The details are in the post that was linked!
Being able to raycast in blocks and spheres is already going to provide a huge improvement to our current raycasted hitbox implementation however a full pill shape would enrich the raycasting experience a lot more. Most hit/hurt/collision box implementations off platform are also done as pills.
Could you be more specific on your use cases for pill/capsules? The spherecast actually forms a pill/capsule as it “travels”
The details, from my use case to shapecasting’s importance to my experience, are in the linked post, I hope that people can read the post over asking redundant information!
Yeah I did, spherecast forms a pill/capsule so not sure what the purpose of specifically pill would be
The shapecasts, especially how they can be used for CCD, are a major step up in mechanisms requiring raycasting. I’m mainly talking about a fixed pill shape, not an “effective” pill, unless they can truly be used in the same way and not “technically” be used in the same way. The hitboxes of Dark Souls are a great example of this, as I’ve talked about in the linked post. This isn’t pushing a shape, it’s having a fixed shape that I can sweep along a path.
The frame data of Super Smash Bros also provides a reference for all this. The details are in the post and I’d prefer not to repeat, that’s why I linked it. Thanks for your input though, but I’m looking for proper replies only and not so much wanting to spend time on a discussion for this.
Ah, this is more along the lines of conventional CCD rather than roblox’s raycasting, yeah I can’t imagine Roblox would add this anytime soon
What you could do is still use spherecast every frame but make the sphere originate from within the player, as the sword shouldnt be doing damage from behind the hilt anyways. Has the same end result, except obviously if you’re swinging extremely fast it wont detect well. If you run into issues, you could just increase the size of the sphere, or perhaps do more spherecasts between the spherecasts to see if the blade swept thru something and missed it, however suboptimal lol