Can Someone Explain ArcHandles To Me?

Hi there,

So I’m working on a little tycoon type thing just for fun. For moving around items on the player’s base, I’m using Handles and ArcHandles.

I got handles to work after a bit, and honestly they work great. Those are the ones used for move/resize in studio.

ArcHandles, however, I am struggling greatly with, in no small part due to my minimal comprehension of basic geometry. The main issue I’m having with them is that the MouseDrag event returns a face, and distance value as expected, but the distance value makes no sense to me whatsoever. From what I can gather it goes from -6 to 6 depending on the direction of mouse movement, and then flips back to the other once it hits the maximum value.

I would include more information but I really don’t understand what it’s doing. Essentially I was hoping someone could just explain it to me a little better?

2 Likes

I have never used ArcHandles so this may not be what you need, but it sounds like the distance is in radians rather than degrees.
360 degrees translates to 6.28319 radians, 180 degrees is pi radians.

1 Like

That would make sense.

If I wanted to convert that, would just calling math.rad(distance) result in a degree value? Assuming distance was something between -6 and 6

Thanks

Other way around, math.rad converts to radians, math.deg is what you need as it converts to degrees. If you ever work on a platform that doesn’t have easy conversions, the function is simple - D = R/Pi * 180

1 Like

Ahh thanks a ton. That makes sense. I’ll mess around with that and see if I get better results.

In the meantime if anyone else has more hands on experience with arc handles, I’m gonna leave the topic unsolved

I also want to know about ArcHandles as well and to know how to use increment on them if say I wanted to restrict it to a 45 degree increment.

Roblox Wiki doesn’t explain the returned parameters of the MouseDrag function well so there should be a good explanation on utilizing ArcHandles.

1 Like

Hey, I found a helpful dev forum article for ArcHandles here if you’re interested.

Here’s a similar example that I have that works as well that I got from a building tool:

local axisangle = Vector3.FromAxis(axis) -- axis parameter used
axisangle = axisangle * relativeAngle -- relativeAngle parameter used
Part.CFrame = previousCFrame * CFrame.Angles(axisangle.X, axisangle.Y, axisangle.Z)
2 Likes