Basicly what the the title says, I want to place an object with a surfaceGUI infront of the player when he or she enters Firstpersonmode. I know how to get the player's camera and how to manipulate it, but i couldn't find this feature anywhere.
Thanks in advance!
-- Local Script, within Backpack/PlayerGui player = game.Players.LocalPlayer cam = Workspace.CurrentCamera cam.Changed:connect(function() if (cam.CoordinateFrame.p-cam.Focus.p).magnitude < 4 then print(player.Name.." is in First Person Mode") else print(player.Name.." is in Third Person Mode") end end)
If you want to lock the Player's camera into 3rd person, check the settings of the Player:
print( game.Players.Player.CameraMode )
Use the Changed
event on the Camera
object to detect when one of it's properties has changed:
previousMode = camera.CameraMode camera.Changed:connect(function() if camera.CameraMode ~= previousMode && camera.CamerMode == "LockFirstPerson" then --Display the message end end)
Assuming that you're actually setting LockFirstPerson in the first place, your question is a bit unclear