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

Why isn't currentcamera working?

Asked by
Zerio920 285 Moderation Voter
9 years ago

I have this in a localscript in replicated storage:

local cam = game.Workspace.CurrentCamera
cam.CameraType = "Scriptable"
local Pos = game.Workspace.Spawn.Flower.Union.Position + Vector3.new(0,3,0)
local Target = game.Workspace.PCoin.Position

cam.CoordinateFrame=CFrame.new(Pos,Target)

I can't find any errors in the output, however the camera doesn't change like I want it to. Anything wrong here?

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

LocalScripts won't run in ReplicatedStorage (it's storage -- things aren't supposed to be running in there)

LocalScripts will run in three places:

  1. In a player's Backpack (can be indirectly, through a Tool or HopperBin)
  2. In a player's character model
  3. In a player's PlayerGui

That makes it the easiest to drop it into the StarterGui if you want it to affect everyone every spawn.


I think they will also run in ReplicatedFirst once.

0
I thought they could run in workspace in some cases too? BSIncorporated 640 — 9y
0
They run in the player's Character, which is in the workspace -- but that's the only place they'll run in the Workspace. Regular Script objects will run in the Workspace, but you should be placing them in ServerScriptService instead. BlueTaslem 18071 — 9y
Ad

Answer this question