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

[SOLVED BY SELF] How to set camera at a certain point until a button is pressed?

Asked by 4 years ago
Edited 4 years ago

I am trying to get my camera to look at in this case a "Drooling Zombie". I have the camera facing at it, but for some reason when I make the camera scriptable it just disconnects it from my player instead of going to the camera point I clarified. (Sorry for the repost)

Script

local camera = game.Workspace.CurrentCamera

local player = game.Players.LocalPlayer

local button = player.PlayerGui.ScreenGui.TextButton

local cameraPeice = game.Workspace.Camera1

repeat
    camera.CameraType = Enum.CameraType.Scriptable
until
    camera.CameraType == Enum.CameraType.Scriptable

repeat 
    camera.CameraSubject = cameraPeice
until
    camera.CameraSubject == cameraPeice

print('camera ready?')

button.MouseButton1Click:Connect(function()
    camera.CameraSubject = player
    camera.CameraType = Enum.CameraType.Custom
    button:Destroy()
end)
0
Not sure if it will fix entirely, but camera.CameraSubject needs to be the characters Humanoid rather than the LocalPlayer object (so game.Players.LocalPlayer.Character.Humaoid IF character and Humanoid exist) centraltrains 60 — 4y

Answer this question