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

Why isn't currentcamera working?

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

✓ Accepted answer

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.

2 comments

0

I thought they could run in workspace in some cases too?

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.

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