Confiner 3D Screen edges - does not work

Hello,

I need to use the 3D confiner with screen edges on my scene.

  • All cameras are ortographic (the game is isometric)
  • Bounding box is bigger than camera at any point

However it does not work. Screen shot attached.

The 3D confining code for screen edges seems broken… or I don’t get the math behind it.

Do I have any other alternative to keep the camera in some boundaries?

I use a group framing transponser and need it to stay in some bounds.

Please advise

Confine Screen Edges only works with 2D confiner.

Can I use a 2D confiner in my situation? Can I rotate a 2D Polygon Collider?

I don’t think so… but not 100% sure.
Can your 3D camera be placed obliquely (with arbitrary rotation) inside your 3D confiner?

https://answers.unity.com/questions/1287583/polygon2d-colliders-getting-messed-up-by-rotation.html

I’ve been trying for a hour to make it work as you said. I can make it work somehow, but the restrictions don’t happen correctly. Meaning the constraints will not push the camera obliquely somehow.

Do you have another workaround in mind?

Can I write a custom confiner?

Any ideea is welcomed :slight_smile:

oh, I wasn’t suggesting a solution… I was inquiring about your scene. I’m trying to understand whether you expect the camera to take on any angle inside your bounding box, or whether you’re restricting it to be axis-aligned.

You could certainly write a custom confiner to suit your needs. Copy the existing one, rename it, and make any mods you want. Thanks to its inheritance, it will show up in the vcam’s Extensions dropdown.

If anyone is interested, I solved the problem by confining the center of the camera and modifying the boundaries of the confiner.
Also making sure that this works on different screen resolutions as I am on mobile.