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

Camera Manipulator Not Working?

Problem: The script does what it is sapose to do the 1st time(clone local script to character and changes camera to camera angle part), but if i reset it does not do it ;-;

Regular Script

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        script.LocalScript:clone().Parent = character
		local scriptss = character:WaitForChild('LocalScript')
		scriptss.Disabled = false
		wait(.1)
		scriptss.Disabled = true

    end)
end)

Local Script

local cam = workspace.CurrentCamera

cam.CameraSubject= game.Workspace.CameraAngle
cam.CameraType = "Attach"
cam.CoordinateFrame=CFrame.new(10,10,10)
cam.Focus=CFrame.new(20,3,2)

1 comment

0

game.Workspace.ChildAdded

1 answer

✓ Accepted answer

It should fire CharacterAdded every time the character is added, so your code may just need some optimization. If it still won't work, try printing when a character is added to see if it actually fires. If it doesn't fire, I'm not sure what I can do if it works the first time, but not the ones after.

The problem is most likely there because searching in a character for "LocalScript" may return something else instead, and is generally an inferior method compared to setting it as a variable, not to mention you used WaitForChild which will wait() indefinitely:

local ss = script.LocalScript:Clone()
ss.Parent = character
ss.Disabled = false
wait(.1)
ss.Disabled = true

Hope I helped!

~TDP

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