How do I rotate meshes?

Note; I really am not incompetent with scripts so please go easy on me.

As the title states. I would like to rotate a mesh around its own axis. I’ve attached a gif down below to showcase the desired effect on a part which I used a CyllindricalConstraint.

Anyone that knows how to do this?

No scripting required for this:
Put a HingeConstraint in the Mesh and connect it to something Anchored.
UnAnchor the Mesh.
Set the HingeConstraint to Motor and the Torque and Rotational Velocity values.
The Mesh should rotate around the axis (the side) the HingeConstraint was attached to.

Either that or if you don’t need players to move with the Mesh then just Anchor it and CFrame rotate it with a CFrame script inside the Mesh. Search https://developer.roblox.com/
for how to CFrame items.

2 Likes
Part = script.Parent
while wait() do
	Part.CFrame = Part.CFrame*CFrame.Angles(0,math.rad(2),0)
end

Put this script inside the Part.
Change the 2 to another number if you want it to be faster/slower

2 Likes

I’m not entirely sure what you mean with setting the Torque and Rotational Velocity values, but I still managed to create the desired effect I was looking for. I put up a GIF down below if you perhaps want to suggest doing something or want to enlighten me on how to do this better (you don’t have to). Either way, thanks for helping me out.

The AngularVelocity and MotorMaxTorque values.
If you want it faster or slower, or have a very large, very dense Part then you may want to increase the torque.

1 Like

Ah, yes I get it now. Thanks man