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

How can you enable and disabe Camera Manipulation?

Asked by 5 years ago

I need help on getting a local script that enables a certain camera manipulation and then disables after a certain time. Can someone help me with it since it doesn't work. I tried to clone the camera local script from ReplicatedStorage to StarterGui then destroys the script so that the camera stops, but it didn't work why?

game.ReplicatedStorage.Camera:Clone().Parent = 
game.StarterGui
wait(15)
game.StarterGui.Camera:Destroy()
0
Why do you clone it into the starter gui? That won't do anything. It just parents a camera to the startergui. You should be setting the properties of workspace.CurrentCamera. programmerHere 371 — 5y
0
How do i do that? User#30241 0 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Why parent a camera to starter gui? CurrentCamera is the best way, because you'd be configuring the options for the player's camera.

local Camera = workspace.CurrentCamera
-- If you want just the localplayer's camera to change, configure the camera using a localscript.
Camera.CameraType = "Custom" -- You'll need more understanding to use the camera types.

You could use CameraSubject to change the cameras primary focus part. It's some cool stuff.

0
Use Enum pls User#5423 17 — 5y
0
Im also guessing he means scriptable camera o.o User#5423 17 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Heres how I did it

local camera=game.Workspace.Camera
local cameraposition=script.Parent.PartPos --This is for the position of the camera

repeat Camera.CameraType=Enum.CameraType.Scriptable untilCamera.CameraType==Enum.CameraType.Scriptable -- I know this looks extreme but it ensures that the cameratype changes properly
repeat Camera.CFrame=cameraposition.CFrame until Camera.CFrame==cameraposition.CFrame

Tell me if you find a better solution

Answer this question