Camera Manipulation: Changing Angles

Hey developers!

I am trying to find out a script that enables you to select a certain tool which upon selecting would switch the camera to a certain angle. I have tried using many different scripts that people have put on the forum but I seem to not have the hang of it.

Anything helps, many thanks! (below is an example of what I want to do)


Basically I am just trying to make a script that can allow me to use a tool to allow me to see the view of blue camera, and be able to use a second tool that can switch to red camera.

When I say tools I mean the player inventory tools.

2 Likes

This is a hint for your problem; a script, which moves camera to certain position and forces the camera to look at certain position:

local camera = workspace:WaitForChild("Camera") -- To manipulate player's camera, you need to use camera object
-- Blue wall's position and one of the blue camera's parts position are needed to manipulate the camera
local blueWall = workspace:WaitForChild("BlueWall")
local blueCamPart = workspace:WaitForChild("BlueCamera"):WaitForChild("CamMainPart")
print("Before the first cam change...")
wait(5)

camera.CameraType = Enum.CameraType.Scriptable -- Used for camera manipulation (can't really explain)
camera.CFrame = CFrame.new( -- camera manipulation can be done by changing camera's CFrame
blueCamPart.Position, -- The camera will move to this position
blueWall.Position -- The camera will look at this position
)

--[[ Objects aren't needed, camera change can be done like this:
camera.CFrame = CFrame.new(
Vector3.new(0, 10, 0),
Vector3.new(0, -10, 0)
)
--]]

print("After the first cam change...")
wait(5)

-- Now we want to camera to stop staring at the wall and give a player freedom.
camera.CameraType = Enum.CameraType.Custom

Forgot to mention that it should be inside a local script.

1 Like