Help on Camera Manipulation

Bear in mind that I have no scripting experience, so I may need extra help.

I want to make a VHS tape type game where the camera teleports INTO a part after some time has passed (to go from frame to frame). But, I do not know about cameera manipulation, I do not know how to script the camera, and I need help, so here I am.

What should I do?

Videos, pictures, etc would be greatly appreciated with you comment!

2 Likes

The player’s camera can only be changed/moved from a LocalScript, to move it you have to use its CFrame property and change its CameraType to Scriptable so that it stays

local Camera = workspace.Camera
local Target = workspace.Part.CFrame
local Info = TweenInfo.new(2)

Camera.CameraType = Enum.CameraType.Scriptable
local T = game:GetService("TweenService"):Create(Camera, Info, {["CFrame"] = Target})
T:Play()
Result

Use TweenService to make it smoother.


Other sources:
Camera manipulation
Tween

1 Like

It works like its supposed to, but 3 questions.
-How can I remove the animation and make the transition instant
-How can I make it so it moves to other parts?
-How can I make it so it DOESN’T go back to the player?

Removing the Tween part

local Camera = workspace.Camera
local Target = workspace.Part.CFrame

Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = Target

Making a list of all positions

local Camera = workspace.Camera
Camera.CameraType = Enum.CameraType.Scriptable

Camera.CFrame = workspace.Position1.CFrame
task.wait(1)
Camera.CFrame = workspace.Position2.CFrame
task.wait(1)
Camera.CFrame = workspace.Position3.CFrame 

This part of the script does

changing CameraType of the camera to Scriptable does not return to its original point which is the player.

2 Likes

Great, I will test it out and mark your as solution if it works

1 Like

Quick Question (sorry for the inconvience)
But how do I label the positions? Do I rename a part? Do I fill the Position one two and three with coordnates?

I assume by labelling a position you mean storing them as values, if so, here’s how you do that!

local pos1 = workspace.Position1.CFrame
local pos2 = workspace.Position2.CFrame
local pos3 = workspace.Position3.CFrame

You can name the label after ‘local’ to whatever you want of course (as long as it has no punctuation in it - apart from an underscore which is fine)

Then you can amend the rest of the code.


Camera.CFrame = pos1
task.wait(1)
Camera.CFrame = pos2
task.wait(1)
Camera.CFrame = pos3

So, the scipt sort of works, it locks on to a part without transition and stays on the part, but it doesn’t move to the next part.
Here is the script:

local Camera = workspace.Camera
Camera.CameraType = Enum.CameraType.Scriptable
local pos1 = workspace.Position1.CFrame
local pos2 = workspace.Position2.CFrame
local pos3 = workspace.Position3.CFrame
local Info = TweenInfo.new(2)


Camera.CFrame = workspace.Position1.CFrame
task.wait(1)
Camera.CFrame = workspace.Position2.CFrame
task.wait(1)
Camera.CFrame = workspace.Position3.CFrame

Camera.CameraType = Enum.CameraType.Scriptable
local T = game:GetService("TweenService"):Create(Camera, Info, {["CFrame"] = Target})
T:Play()