Make in game camera have the size of the screen

Is it possible to make the in game camera have the size of the screen and be positioned in a way that if I put stuff in front of the camera it will be like I put stuff under the 2D screen entity?

Basically I want the in game camera to act like a 2D screen entity. A world 2D screen if you will. This needs to work for different screen dimensions, so I can’t just position the camera to look at the 2D screen in the editor.

Help? ;_:

I’m sure its possible. At the end the 2D screen is a camera with ortographic projection and a bunch of meshes representing buttons and similar. And some math on the placement of elements.

What exactly are you trying to do?

I am trying to place an object in front of a camera, that always look the same regardless of the screen dimensions. You know like you can anchor elements on a 2D screen for example on the top. I want to do the same but anchor a 3d model.

I’d probably do a system which handles some simple anchoring in screen space … and than use the camera to transform that point to world space - that’s where you need to place your mesh.

https://developer.playcanvas.com/api/pc.CameraComponent.html#screenToWorld

1 Like