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

Intro camera manipulation ?

Asked by 4 years ago

I want to do an intro, for my game, manipulating the camera. I programmed this, but it doesn't work for me when I play it.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera

local playButton = script.Parent.Play

repeat wait()
    Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = workspace.CameraPart.CFrame

playButton.MouseButton1Click:Connect(function()
    Camera.CameraType = Enum.CameraType.Custom
    playButton:Destroy()
end)

Basically when I give it to play it does nothing and only shows the play button. It doesn't change my view to the CameraPart.

0
You need to set the CameraSubject Ziffixture 6913 — 4y

1 answer

Log in to vote
1
Answered by
Rinextel 291 Moderation Voter
4 years ago

Hello, nanitook! Great question you asked. I have assembled a script below that should accomplish what you're trying to do.

local Player = game:GetService("Players").LocalPlayer
local CamPart = game:GetService("Workspace"):WaitForChild("CameraPart")
local Cam = game:GetService("Workspace").CurrentCamera

Cam.CameraType = "Scriptable"
Cam.CFrame = CamPart.CFrame --Sets the camera CFrame to the part CFrame


This script should work! Make sure this is in a local script and not a server script and it should work just fine!

0
What have you changed? Ziffixture 6913 — 4y
0
Still not working :( nanitook 13 — 4y
0
Works fine for me. Rinextel 291 — 4y
0
And where is the script located [what service]? Rinextel 291 — 4y
View all comments (4 more)
0
its in StarterGui nanitook 13 — 4y
0
May I see the full script? It seems to work fine with me. Are any errors occurring? Rinextel 291 — 4y
0
Try setting the camera subject. Rinextel 291 — 4y
0
it works now, i removed an admin script and work nanitook 13 — 4y
Ad

Answer this question