Non-central offset for the Camera's Focus or Field of View

Continuing the discussion from How can I move the camera's field of view centre onto a different part of the screen?:

As a ROBLOX developer it is currently impossible to change the Camera’s focus from the centre of the screen to another point on the screen. Here is an image to illustrate what I mean:


By default the camera focuses on the green circle - directly in the centre of the screen. There is no way to move this focus onto another part of the screen, in this example that would be in the red circle. Instead, I need to use a workaround such as by increasing the field of view, but this is not a solution, more of a quick hack (As demonstrated in This video).

My usecase here is that I would like the UI to take up the left ~35% of the screen and the top ~30% of the screen, but I would still like my camera to be focused on the model in the bottom 65%/60% portion of the screen. Unfortunately it is restricted to the centre. Viewmodels will not work as my character will be made entirely of Particle Emitters, which are not rendered in viewmodels.

Allowing developers to change the central focus of the camera in terms of a player’s screen will provide a tighter grip over the crucial game-play element that is the camera.

One solution I propose is for the camera to be given a GUI style UDim2 property with which they can move the camera’s focus in pixels or in scale across the user’s screen, or alternatively an AnchorPoint which they can move about (as currently it is set at 0.5, 0.5).

2 Likes

This is actually possible by messing with the camera’s CFrame!

@Reselim created a handy module that does all the work for you!


Here’s the open source repo:

Usage is wonderfully simple:

local Resize = require(path.to.module)

Resize.Position = UDim2.new(0.1,0,0.1,0) -- These CAN be changed on the fly, as shown in demo vids
Resize.Size = UDim2.new(0.9,0,0.9,0)

Resize.Start()
48 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.