Player not turning

I’m trying to have the player teleport infront of the “MouseTarget” AND have the player look towards the “MouseTarget” but it isn’t working.

		print(MouseTarget.LowerTorso.Orientation - Vector3.new(0, 180, 0))
		player.Character.HumanoidRootPart.Orientation = Vector3.new(0, 180, 0)

		player.Character.HumanoidRootPart.Anchored = true
		MouseTarget.HumanoidRootPart.Anchored = true
		
		MouseTarget.HumanoidRootPart.Position = MouseTarget.HumanoidRootPart.Position
		player.Character:SetPrimaryPartCFrame(MouseTarget:GetPrimaryPartCFrame()*CFrame.new(0, 0, -4))

have you tried using cframe.angles instead? (make sure to use math.rad)
since orientation, is based off of world positions, and angles is based off cframe.

Try using CFrame.lookAt. This code might work:

local CharHRP = player.Character:FindFirstChild("HumanoidRootPart")
local MTHRP = MouseTarget:FindFirstChild("HumanoidRootPart")

CharHRP.CFrame = CFrame.lookAt(CharHRP.Position, Vector3.new(MTHRP.Position.X, CharHRP.Position.Y, MTHRP.Position.Z))
1 Like

J_Angry his answer worked combined with teleporting the player before making the player face the right direction

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.