Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is their anyway to stop the part from following player rotation?

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?

2 answers

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.