I am creating a “Lightsaber block” where the block has the ability to carve into other bricks with realtime CSG. I cannot create the part required for subtracting at the hit part’s Position because this will become very inaccurate for bigger parts. Is there any way to get the position of where two parts touch? I have attempted to do so with rays, but have had no luck.
Why not just create negated parts where the lightsaber blade itself is whenever it touches something?
You’ve listed the only real method available and said that it won’t help, so no, you probably can’t accomplish this in the first place. I don’t see any other way to get the position when Touched is fired other than indexing position itself.
That aside, your system itself isn’t really able to be accomplished. This would be insanely expensive for the rendering engine and solid modelling API to handle. This involves recalculating and constructing a new asset whenever your block moves, which the engine is already incapable of handling that many operations a frame. Once the calculation is done, it needs to render the block and anything around it (e.g. lighting). And that’s just a few processes to name.
I don’t know about this one. Doesn’t seem like it can be accomplished on Roblox as of now. Assuming you intend to have this support arbitrary shapes, even moreso.
Rays are the only way to get the position of the points of intersection, but there might be other ways that are unneficient.
The way I think going about this would be laggy because of what everyone said above but would technically would work. It would involve doing math and calculating the collisions(the easy part) then creating a part, negating it, and then unioning if with the main part. I wouldn’t recommend doing this as it would require a lot of resources doing.
You should be able to duplicate the lightsaber block and use it and the part(s) it touches with BasePart:SubtractAsync.
It could be laggy though, depending on the speed of your client.