I want to print "Player is now in first person." every time the player goes into first person. How would I do this? I have checked developer.roblox.com, but it doesn't seem to have an event for going into first person.
Edit: After it detects that the player is in first person, how would I detect when the player leaves first person?
You have to use magnitude
which is the distance between parts. Make sure it's a LocalScript.
local function isFirstPerson() local camera = workspace.CurrentCamera local character = game:GetService("Players").LocalPlayer.Character or game:GetService("Players").LocalPlayer.CharacterAdded if (character.Head.CFrame.p - camera.CFrame.p).magnitude < 1 then return true else return false end end while wait() do local isFirstPerson = isFirstPerson() if isFirstPerson == true then print("Player is now in first person.") end end
The isFirstPerson()
function returns true if the player is in first person.