Camera focus on a part

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    Hello, i want to do a system that when you click on a certain part it focus on it like that
    : https://gyazo.com/fb9746e3dda3a8b0af121744342626e6

  2. What is the issue?
    I don’t know how to do it.

  3. What solutions have you tried so far?
    Looked on forums.

1 Like

You could put a part in front of the desired place for the camera to be and that would reference the camera position then once they click it tween their camera position to that blocks position?

Here is stuff on camera manipulating. Camera Manipulation (roblox.com)

I can try to do that to see if that work.

Alright good luck! If you need more help just reply.

A useable approach:

local tweenService = (game:GetService("TweenService"));

local object = (...);
local camera = (workspace.CurrentCamera);

function FocusCamera(UP_OFFSET, BACK_OFFSET)
	camera.CameraType = Enum.CameraType.Scriptable
	local cameraPosition = (object.CFrame * CFrame.new(0, UP_OFFSET, BACK_OFFSET)).Position;

	tweenService:Create(camera, TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
		CFrame = CFrame.lookAt(cameraPosition, object.CFrame.Position)
	}):Play()
end;

That just freeze the camera, like the start of a freecam

You have to implement it properly to fit to your own game needs.
I just showed a valid approach to use in order to position the camera in front of an object.

One way to do it is (in a local script) changing the CurrentCamera’s (witch can be accessed with workspace.CurrentCamera) CameraSubject property to the part you want it to focus on.