Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I check to see if a player's camera is in FirstPerson, and change it to ThirdPerson?

Hello again! In one of my scripts that involves Camera Manioulation, I found that if the player is in first person, I can not zoom out of it (Which is needed). So I was wondering if there was a way to check to see if a player is in first person and change it to thirdperson!

I'm not sure how to do that but I can do this!

script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") ~= nil then
		if game.Players:GetPlayerFromCharacter(hit.Parent).CameraMode == "LockFirstPerson" then-- I know this isn't right but I don't know how to check if the player is in first person
			game.Players:GetPlayerFromCharacter(hit.Parent).CameraMode = "Classic"-- This won't change to third person but I'm not sure how I can do that!
		end
	end
end)

Thanks!

~Mini

2 answers

✓ Accepted answer

LockFirstPerson when checking, must be checked usingEnumeration, not Strings.

script.Parent.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") ~= nil then
        if game.Players:GetPlayerFromCharacter(hit.Parent).CameraMode == Enum.CameraMode.LockFirstPerson then
            game.Players:GetPlayerFromCharacter(hit.Parent).CameraMode = "Classic"
        end
    end
end)

1 comment

0

Okay! That's good to know! Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.