cjy9
New Member
Posts: 1
|
Post by cjy9 on Sept 12, 2022 21:08:49 GMT
Hi,
I'm using Unity 2020.3.36f1 and Pro Camera 2D 2.9.3 version. I'm having some issue using Numeric Boundaries.
On ProCamera2DNumericBoundaries.cs line 158~159? (I edited my script so it might not be accurate), there's var halfScreenWidth and var halfScreenHeight. When I Debug.Log() those two values, they seem to be returning incorrect values. Which resulted in the boundaries going over / under the defined boundaries.
When I set the aspect of game window to 16:9, they respectively return (5.876316, 5.21763). Then, if I were to change the aspect into Full HD mode (1920 * 1080), which should have the exact same ratio as 16:9, the values change to (7.498565, 4.21875). I don't understand how ScreenSizeInWorldCoordinates can give two different values when the actual amount things I can see remain unchanged.
I do have Pixel Perfect Camera (Experimental) component from Unity which alters the aspect ratio a bit, but disabling that component still yielded a same result.
I think something goes wrong when initially setting the ScreenSizeInWorldCoordinates value. Is there any way I can check and force-set the ScreenSizeInWorldCoordinate to be a correct one when I load the application?
|
|
|
Post by Luís Pedro Fonseca on Sept 12, 2022 22:40:36 GMT
Hi cjy9,
The ScreenSizeInWorldCoordinates should always give you the correct values. Can you please try to call `CalculateScreenSize` before trying to get the value and see if it fixes it for you?
|
|