CFrame.LookAt() not working

CFrame.LookAt() not working for mobile players, only for PC
I’m guessing this is due to camera settings. Here is my code

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		while task.wait() do
			char.HumanoidRootPart.CFrame = CFrame.lookAt(
				char.HumanoidRootPart.CFrame.Position,
				Vector3.new(
					0,
					player.Character.HumanoidRootPart.CFrame.Position.Y,
					50.29999923706055
				)
			)
		end
	end)
end)
1 Like

Use SetPrimaryPartCFrame for the character. Also, I recommend not putting any loops in CharacterAdded events, as that will cause memory leaks.

Nah still not working. It’s mobile that has an issue. Just doesn’t work on mobile due to camera settings. I’d have to write up an entire camera module just to fix this

Interesting. I’d write a Bug Report on the forum since this seems like a ROBLOX issue

1 Like