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

How do I make a script that fixes the Character Camera automatically?

I want it to like fix the camera every like let's say 5 minutes. How would I start?

1 answer

To do this the normal way would be to just reset the character but I'm going to do it differently as the character reset might be annoying to players.

This code is for a LocalScript

fixtime = 60*5 -- 5 minutes in seconds. (Just change the 5 to how many minutes you want in between camera fixes)
cam = workspace.CurrentCamera

while true do
	wait(fixtime) -- Wait set time
	cam:Destroy() -- Remove old camera
	wait(0.1) -- Camera gets replaced automatically by the game
	cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid -- Reset the settings of the camera
	cam.CameraType = "Custom"
end

I tried to explain some what the code does but you can remove it if you want

3 comments

0

I'm talking about glitched cameras like in the Capture the flag roblox loadout map When you move your camera during the ending your camera get's stuck and when you reset i doesn't do anything.

0

As far as I know this code should fix the camera even in that case because this doesn't reset your character it makes a whole new camera object for your character

0

You need to reset after it or make health 0 then it will work fine again

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