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

How do I make camera tool that only views that specific camera?

Asked by 8 years ago

I am building an obstacle course and I like to manually view the cameras like.... When you select the tool, It goes to that specific camera for example StartingRamp Camera and then when you deselect the tool, it goes back to the character. I don't really have an idea what to do and I don't know if you understand the english but I think you got the point.

1 answer

Log in to vote
0
Answered by 8 years ago

You cant really have different cameras, even if they're in workspace. Every player has its own camera and if you wanted to have something where the player equips the tool and the camera Moves Position instead of 'Switching Cameras' then you can do something like this:

-- Put this inside the tool you want, this also has to be a local script and put inside StarterPack or StarterGui.

local tool = script.Parent

local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera

local blockPosition = game.Workspace:WaitForChild('Put a block where you want your camera to be located in')

tool.Equipped:connect(function(mouse)
    camera.CFrame = CFrame.new(blockPosition.Position)
end)

tool.Unequipped:connect(function(mouse)
    camera.CameraSubject = player.Character:FindFirstChild('Humanoid')
end)
Ad

Answer this question