Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera Manipulator Not Working?

Asked by 8 years ago

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)

0
game.Workspace.ChildAdded FlaminSparrow 65 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

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

Ad

Answer this question