#how to use AlignOrientation to slowly turn to a look at position?
1 messages · Page 1 of 1 (latest)
function alignOrientationDuo(follower,target,speed,rotationResponsiveness)
local alignPosition=Instance.new("AlignPosition")
alignPosition.Attachment0=follower.Attachment
alignPosition.Attachment1=target.Attachment
alignPosition.MaxForce=math.huge
alignPosition.MaxVelocity=speed
alignPosition.Responsiveness=200
alignPosition.Parent=follower
local alignOrientation=Instance.new("AlignOrientation")
alignOrientation.Attachment0=follower.Attachment
alignOrientation.Attachment1=target.Attachment
alignOrientation.MaxTorque=math.huge
alignOrientation.MaxAngularVelocity=200
alignOrientation.Responsiveness=rotationResponsiveness or 200
alignOrientation.Parent=follower
end
function alignOrientationDuo(follower, target, speed, responsivenes)
local alignPosition = Instance.new("AlignPosition")
alignPosition.Attachment0 = follower.Attachment
alignPosition.Attachment1 = target.Attachment
alignPosition.MaxForce = math.huge
alignPosition.MaxVelocity = speed
alignPosition.Responsiveness = 200
alignPosition.Parent = follower
local alignOrientation = Instance.new("AlignOrientation")
alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
alignOrientation.Attachment0 = follower.Attachment
alignOrientation.MaxTorque = math.huge
alignOrientation.MaxAngularVelocity = 200
alignOrientation.Responsiveness = responsivenes or 200
alignOrientation.CFrame = CFrame.lookAt(follower.Attachment.WorldPosition, target.Attachment.WorldPosition)
alignOrientation.Parent = follower
end