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

Camera Tool? Camera goes to a brick

Asked by 5 years ago

Hello, i was wondering how to make a Camera Tool with i think CFrame (basically a when you equip the tool the camera goes to the block) I dont know anything about scripting so it would be helpful if someone could help me.

0
ur copying me HollyIsTheBestOne -48 — 5y
0
Lol, i when i made this i saw your thing XD DFROBUXX 28 — 5y
0
Search up Camera Manipulation in roblox wiki and they got u covered. 123nabilben123 499 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Ey I found a solution to mine, so give me credit. when you make the variable for the tool for example

cameratool = game.StarterPack.CameraTool

what you need to put is

cameratool = script.parent
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Make a Tool with a Handle in starterpack with a LocalScript inside containing the following:

local Handle = script.Parent -- the tool's handle
local Tool = Handle.Parent -- the handle's parent
local Camera = workspace.CurrentCamera -- CuurentCamera refers to the camera being used, which is the camera the player is using to see around them.
local Me = workspace.Me -- Me is a Part.
local Player = game.Players.LocalPlayer

local Viewing = false
Tool.Activated:Connect(function()
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.Me.CFrame
if Viewing == false then
Camera.CameraSubject = Me
Viewing = true
elseif Viewing == true then
Camera.CameraSubject = workspace[Player.Name]
Viewing = false
Camera.CameraType = Enum.CameraType.Custom
end
end)

Answer this question