Rotating Parts with Vector3 Values
Rotating Parts with Vector3 Values
Problem
You want to get a part to rotate in a direction.
Solution
Use the BodyAngularVelocity object.
local b = Instance.new('BodyAngularVelocity')
b.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
b.angularvelocity = Vector3.new(0, 10, 0)
b.Parent = Workspace.Part
Discussion
The BodyAngularVelocity
object uses its AngularVelocity
property to determine speed and rotation. This time instead of using the maxForce
property, we used maxTorque
which is rotational power.
There is a possibility this object will be phased out. It is currently not marked as deprecated. Use with caution.