I'm trying to make "A" happen below whenever a player is within 10 studs of part, but I cannot get the CurrentCamera because this is inside a Script and not a LocalScript. Is there a work-around for getting the player's position into "camera.CoordinateFrame.p" below?
Note: This is a single player game and there are no other players in the server.
camera = game.Workspace.CurrentCamera part = --part location here if (camera.CoordinateFrame.p - part.Position).magnitude < 10 then -- check if you're less than 10 studs away --A end
There is no way to get the Camera
object from the server.
You're going to have to either use a LocalScript, and put it in somewhere that replicates to the client - e.g. StarterPack or StarterGear - OR use a RemoteFunction to recieve the camera's data.