local i = 0 local Distance = 5 local Speed = 0.07 local Angle = 0 local Part = script.Parent local Orbiting = script.Parent.Parent.HumanoidRootPart while true do i=i+1 wait() Part.CFrame = Orbiting.CFrame*CFrame.fromEulerAnglesXYZ(Angle,i*Speed,0)*CFrame.new(0,-2,Distance) end
The 'Part' slowly orbits the player but if the player rotates the part follows the player roatation, is there anyway to prevent this?
By using Orbiting.CFrame you're getting the player's rotation, you can instead create a new CFrame with no rotation through the following:
CFrame.new(Orbiting.Position)
I can't see the whole line, but consider using the position of the character rather than the CFrame as that contains the rotation.
CFrame.fromEulerAnglesXYZ()*CFrame.new() + Orbiting.Position