i have a rotating saw i made with angular velocity and hinge constraint, but i need it to rotate locally by its side and not globally
i looked on the developer forum and turns out i should use VectorToWorldSpace using the cframe of the object itself, but i have no idea how to do this:
here’s a vid of the issue:
here’s what i tried:
local saw = workspace["saw 2"].default
-- stationary part
local stationary = workspace["saw 2"].stationary
-- new instance angular velocity
local angularVelocity = Instance.new("AngularVelocity")
-- new instance attachment1
local attachment1 = Instance.new("Attachment")
-- parented under saw object
attachment1.Parent = saw
-- new instance attachment0
local attachment0 = Instance.new("Attachment")
-- parented under stationary part
attachment0.Parent = stationary
-- new instance hinge constraint
local hingeConstraint = Instance.new("HingeConstraint")
-- attach attachment0 to attachment0
hingeConstraint.Attachment0 = attachment0
-- attach attachment1 to attachment1
hingeConstraint.Attachment1 = attachment1
hingeConstraint.Parent = stationary
--attach angularvelocity attachment to attachment0
angularVelocity.Attachment0 = attachment0
--angular velocity torque is math huge
angularVelocity.MaxTorque = math.huge
angularVelocity.Parent = saw
-- angular velocity angularVelocity is vector3 new
angularVelocity.AngularVelocity = stationary.CFrame:VectorToWorldSpace(Vector3.new(8,0,0))
here’s what i looked into, i’m not sure what self.yaw is in the post: