J9White
(J9White)
September 1, 2023, 4:09pm
#1
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
NotRapidV
(Rapid)
September 1, 2023, 4:28pm
#2
Use SetPrimaryPartCFrame
for the character. Also, I recommend not putting any loops in CharacterAdded events, as that will cause memory leaks.
J9White
(J9White)
September 1, 2023, 4:42pm
#3
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
NotRapidV
(Rapid)
September 1, 2023, 4:57pm
#4
Interesting. I’d write a Bug Report on the forum since this seems like a ROBLOX issue
1 Like