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

Howdy!

I haven’t seen this used anywhere and I cannot find an answer, nor figure it out. Let me illustrate my problem in one simple picture:


As shown in the image above, cameras in ROBLOX centre their vision in the middle of the screen, somewhere in the green circle. This makes sense! However for my implementation I want to dedicate the left ~35% of the screen and top ~30% of the screen to UI, but I don’t want to have to resort to using an off-centre camera. My ultimate goal is to shift the camera’s field of view focus into the red circle.

I expect your first thought would be “Just use a viewmodel instead”; ordinarily this would work, but not here. One of the things that will be shown in the bottom right part of the screen is made entirely of particle emitters - and if you didn’t know, particle emitters do not render in viewmodel.

So that has left me stumped. It’s not as simple as changing the camera focus, as that will still remain in the centre of the screen. Is this even possible? Has anybody got suggestions for another method that I could use to implement this full-screen multi-layered UI?

I look forward to hearing your answers! :slight_smile:

2 Likes

I dont understand, but if you need to change camera target, do
camera.CFrame = CFrame.new(camera.CFrame.p,targetPosition)

I appreciate the effort @mistr88.
For anybody that might think that solution would work, all it takes is trying it in studio. Here’s a demonstration:

Before changing the camera target:


After changing the camera target to the dummy’s Torso:

As you can see, like in the original post, this is not what I want. The centre of the camera is directly in the middle of the screen (in the green circle), it has not moved to the red circle.

1 Like

I’m having trouble on what you are trying to achieve but it sounds like you need to change the camera offset.

Yeah I suppose so, except I don’t want to shift the target offset (which I know how to do) I want to shift the field of view offset.

I don’t think there is a possible way to do that but while looking, I believe that this may be as close to what you want, which is simply tweening both the CameraOffset and FieldOfView.
https://gyazo.com/dedd266fe19b36f6ee997e8c4173bd94

4 Likes

Great video, thanks @HeyItzDaredevil, that is pretty much how I want my UI to look.

Obviously this solution isn’t perfect as the camera’s focus is still on the centre of the screen, but this is a great workaround and I will resort to using this method if nobody else can come up with the exact solution that I’m looking for.

1 Like

I’m afraid this is not possible… yet. Why don’t you create a topic in #platform-feedback suggesting this? I think this is a great idea, and who knows, Roblox could implant it in a near future.

1 Like

Just FYI, it is possible. Take a look at this response from boatbomber in feature requests:

1 Like

Thanks for the information and for marking it as a solution for future reference.

Also I recently saw another cool demonstration of “CFrame matrix distortion” by TheGrandBraker. You might also find it nice, or useful since it’s based on the same property.

2 Likes