Help With Hinge Like Rotation

Hello, I have a 1x1x1 part that is connected to another part through a weldconstraint. My goal is for when the 1x1x1 part rotates the other part rotates with it; that way the larger part is rotating around an axis besides its middle.
image

My first script was basically this
1x1x1 part.Orientation = Vector3.new(0, (Frame.Rotation * -1), 0)
Which worked; however the part welded to it didn’t rotate with it.

I then tried using this script which does rotate the welded part but not accurately or smoothly, as shown in the video below.
Hinge.CFrame = Hinge.CFrame * CFrame.Angles(0, (Frame.Rotation * -1), 0)
https://gyazo.com/2c3115434b07d8d5c890e6190db3b914

The white bar on the joystick acts like a compass and always rotates to point in the direction that the joystick is moved. This way I can get the rotation of the bar and apply the same rotation to the 1x1x1 part.
image

How can I make the 1x1x1 part accurately rotate in the same direction as the white bar, while also having the welded part rotate with it? Thanks!

Are you working with 1-360 degrees? If so you’re going to need to use math.rad(number)!

1 Like

Yes, so I added math.rad and it’s working much better. However it moves the player back to the center of the workspace like this
https://gyazo.com/528a82817832640f5f75e926916f14dd
What could by causing this? Thanks.

If welded, you can try to swap Part0 and Part1. It’s been so long since I’ve worked with welds so I forget which is which.

If not you might want to make sure it’s not CanCollide.

So the 1x1x1 part is moving to the spot which is also moving the whole player there, as you can see in this video.

https://gyazo.com/74288635a0c675a548decd10deb7ef81

The forcefield also spawns where the player always moves to as in the video, however no part of the model is in the area that the forcefield spawns. Could there be a correlation between the forcefield spawning in the same spot the the player always moves to?

This is the only part of the script that actually moves the hinge (1x1x1 part).

Hinge.CFrame = CFrame.Angles(0, math.rad(Frame.Rotation * -1), 0)
HingeBodyGyro.CFrame = Hinge.CFrame
ObjectBodyGygro.CFrame = Hinge.CFrame