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

Is there a way to keep switching the players camera, more than twice?

Asked by 4 years ago

I'm not sure if it's normal or not, but I can only switch the player's camera twice. But If they reset, they can do it twice again. One script, this one switches the player's camera to the part. The other switches it back to the player. In total, it will just switch to the part, and back to the player. Oh, yeah and I have a click detector with 2 scripts, than enable these, when clicked. Its a function, its the best way I could find out how to do it.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace:WaitForChild("Camera")
local camera = workspace:WaitForChild("CameraPart")
repeat wait()
    Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = camera.CFrame
script.Parent.CameraEnabler.Disabled = true

1 answer

Log in to vote
0
Answered by 4 years ago

Unless I'm wrong, you could use TweenService on your camera to repeat it as many times as you want... If that's what you're asking.

0
I haven't used that before, so Ill need to test it zandefear4 90 — 4y
0
Would you happen to know an example..? zandefear4 90 — 4y
0
https://developer.roblox.com/en-us/api-reference/function/Camera/Interpolate/index.html You could read up on this, it shows you about camera manipulation with Tweening. Auxatier 59 — 4y
0
Thanks, Ill check it out. zandefear4 90 — 4y
Ad

Answer this question