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

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

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 **

2 comments

1

Fallow lol

0

?

1 answer

✓ Accepted answer
    c.CameraType = "Follow"

1 comment

0

Thanks, ill +1 but its still not changing it when i change the value

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