I have been trying to make the camera go inside of a object but it doesn't move to that object.
local c = workspace.Camera local cc = workspace.CurrentCamera c.CameraSubject = workspace.Gadgets.Model.Part2 c.CameraType = "Scriptable" cc.CameraSubject = workspace.Gadgets.Model.Part2 cc.CameraType = "Scriptable"
I put that code in a localscript inside of StarterGui. Help please.
Local Script
local player = game.Players.LocalPlayer local part = workspace.Gadgets.Model.Part2 local c = workspace.Camera c.CameraSubject = workspace.Gadgets.Model.Part2 c.CameraType = Enum.CameraType.Scriptable local cc = workspace.CurrentCamera cc.CameraSubject = workspace.Gadgets.Model.Part2 cc.CameraType = Enum.CameraType.Scriptable player.CameraMode = Enum.CameraMode.LockFirstPerson
If you've seen the Camera Modes in the player (Default is Classic), the second option, as depicted above, is "LockFirstPerson" which will put the camera in the POV of the Part you're changing the camera subject to (Doing this with the normal player will place the camera CFrame within the player's Head).
I recommend doing this after you've set the camera subject, or else it will occur too early. The only drawback to this is that the mouse cannot freely move around the screen, and must stay in the center.
Also, using the CameraType's Enum is better to prevent glitches, even though the string itself usu. works.