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

Value Not Working| Camera not changing with value? [Edited] [UnSolved]

Asked by 9 years ago

Idea(This Is Just a section) The code creates a backdrop and focusing the camera on the backdrop, depending on if the value is active or inactive.
Problem The code is working... when the script goes through for the initial time when the server launches. I'm not sure how to solve this.
Code:

function updateBackdrop()
    local x,y = self.AbsoluteSize.X,self.AbsoluteSize.Y
    local cx,cy = math.floor(x/2),math.floor(y/2)
    local cz = GetDepthForWidth(40,x)
    local ratio = y/x
    local pos = ScreenSpaceToWorld(cx,cy,cz)
    backdrop.Size = Vector3.new(40,40*ratio,0)
    backdrop.CFrame = c.CoordinateFrame * CFrame.new(pos)
    if game.Workspace.v.Value == false then
    c.CameraType = "Scriptable"
    c.CoordinateFrame = CFrame.new(9999,9999,9999)
    if game.Workspace.v.Value == true then
    c.CameraType = "Follow"
    end
    end
    end

updateBackdrop()
rs.RenderStepped:connect(updateBackdrop)

** Thanks :D **

1
Fallow lol User#5978 25 — 9y
0
? pluginfactory 463 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago
    c.CameraType = "Follow"
0
Thanks, ill +1 but its still not changing it when i change the value pluginfactory 463 — 9y
Ad

Answer this question