How to "wrap" part around another part

I’m making sukuna’s cutting technique, the places cut will be getting an effect that has black in the center and white on the edges, wrapping around the part at random angles. There is a problem though, i dont know how to get the sizes for this.

size 1

still using size 1

have to change size

edit: maybe i should just make it the exact angle as the part

1 Like

This is an interesting problem. I think you might be able to solve it using trig. I’m a little rusty at trig though so my solution might not be 100% correct. Here’s a picture of what I’m thinking:

If you know the angle theta that you want the cut to occur and the center point that you want to place the cut at, then you can find d such that the effect can wrap around the part. s is half the size of the part that’s getting cut. Knowing those values, you can calculate d = s / cos(theta) and set the size of the cut to d * 2. You might need to adjust d slightly to make sure it’s wrapping as you’d like, but I think this is the general solution.

1 Like

This is how you would get the size to answer your problem, if you want this to happen live in game, you’re going to have to use CFrame.FromMatrix() with CFrame Vectors to find where to position the part.

1 Like