(solved, whoops) Issue with multiple cameras

I’m having trouble when using an Ingame draw command where two shapes are drawn. From my testing I believe one is drawing for the editor view and the other for the ingame view, except the game camera is rendering both, yet they have different transformations applied to them, where the shape that is exclusively ingame is affected by the camera’s transform.

In the image above I have a layout that shows my set up that has led me to believe this. On the right I have the script that is calling a simple draw command, which should be a circle on the xy place at position (0,0) with a radius of .5f

This script is on an object with a default transform.

Next, I slightly offset the camera in one direction to show how one of the two shapes being rendered on the game view responds to the camera’s position. It seems that this object is rendering at (0,0) in the camera’s space, while in the scene view above that you can see a single shape that is rendered at the world position (0,0).

I’m not sure if I have something configured wrong here or if instead perhaps it’s a version issue. I’m on unity version 2023.1.8f1 and ALINE version 1.7.4

I’ve used ALINE for some time on other projects and find it to be a super useful tool and would like to keep using it if possible so any help is much appreciated!

Already found something new that indicates it’s a “me” issue. I found the exact same behavior when using Gizmos.DrawWireCube, so it’s probably some sort of weird config I have, I’ll keep looking into it and report what I find.

Turned out to be a quick journey, found the solution in this thread - https://forum.unity.com/threads/gizmos-are-drawn-to-all-cameras.117743/

I totally forgot about my UI camera, and discovered the issue comes from having the two cameras. I’ll look into ALINE’s options for rendering to specific cameras, but if this configurations not supported that’s ok too.

1 Like