Do shapecasts work like this? Is it just like a very thin ray and at the end of it, it is just a detecting block/sphere with volume?
Shapecasts pushes the entire block or circle along the path
Well, How would I achieve a hit detection effect with spherecast on a projectile like this?
The path is only in one direction but how can I have it detect parts from all directions?
Edit: Or is :GetPartsinPart() Better for this?
I was hoping for SphereCast to be like SpatialQuery hitbox except better accuracy and performance.
What if you use GetPartBoundsInRadius()
I have tried hit detection using those methods before. It works perfectly fine but not exactly that well on fast-moving projectiles.
What if you kept retrieving the result.position multiple times? Do you think that could give all the points that touched the raycast?
Well what I want is simply to just have it be exactly at the center. I just have no idea how to set the direction argument for it
I’m sorry then, cause I don’t really know how to.
Typically, the method used is spherecasting between the projectile’s position on the last frame and its position on the current frame.
:Spherecast(Blast.Position, Blast.Size.X/2, LastPosition-Blast.Position, Params)
Roblox doesn’t have build in sphere casting like unity. The best way IMO is to fake/approximate it with multiple raycasts. For example, with a sphere cast you could do multiple raycasts along the edges and in the center (depending on size, for larger ones you’ll need more in the middle). If you want it to be more accurate you could polish up the result with short raycasts at the end to find the exact first collision point for the sphere cast.
Shape casting was released a few days ago as Twexdy pointed out.
Actually, Roblox very recently released an update to support shapecasts:
Yes, this should work fine. Just don’t forget to declare the
LastPosition variable outside of the connection.
No way, that’s awesome! That’s been such a highly requested feature for so long now.
Thanks for letting me know!
I’ve tried this and it only detects parts that are in front of it, such as a wall or player. Doesn’t work on floors (baseplate), instead it just phases through them
And even then, the hit detection is really late as the projectile only stops moving a second AFTER it was phased through the wall
Can you provide more context on the code of your projectile?