# Errors rendering of the zed-unity plugin

**URL:** <https://community.stereolabs.com/t/errors-rendering-of-the-zed-unity-plugin/8689>\
**Category:** Unity\
**Created:** [April 26, 2025, 1:15am UTC](https://community.stereolabs.com/t/errors-rendering-of-the-zed-unity-plugin/8689 "2025-04-26T01:15:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mistikyork](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mistikyork/32/2946_2.png) [@Mistikyork](https://community.stereolabs.com/u/Mistikyork)\
**Post date:** [April 26, 2025, 1:15am UTC](https://community.stereolabs.com/t/errors-rendering-of-the-zed-unity-plugin/8689/1 "2025-04-26T01:15:46Z")

</div>

Good day! Found a bug in the zed-unity code that was causing the right camera to not show up on the display when using OpenXR.

-transform.localPosition assign attempt for ‘Frame’ is not valid. Input localPosition is { Infinity, -Infinity, 0.150000 }.

This problem is written here: [Zed-unity plugin - stereo rendering - AR passthrough for Quest 3](https://community.stereolabs.com/t/zed-unity-plugin-stereo-rendering-ar-passthrough-for-quest-3/8544)  
Grok 3 suggested me to make a fix in this code:  
float plane\_distance = 0.15f;  
Vector4 opticalCenters = zedCamera.ComputeOpticalCenterOffsets(plane\_distance);

if (side == 0) // Left eye  
canvas.transform.localPosition = new Vector3(opticalCenters.x, -1.0f \* opticalCenters.y, plane\_distance);  
else if (side == 1) // Right eye  
canvas.transform.transform.localPosition = new Vector3(opticalCenters.z, -1.0f \* opticalCenters.w, plane\_distance);  
This code replaced with:

Vector3 newPosition;  
if (side == 0)  
{  
newPosition = new Vector3(opticalCenters.x, -1.0f \* opticalCenters.y, plane\_distance);  
}  
else if (side == 1)  
{  
// Check for infinite values  
float rightX = float.IsInfinity(opticalCenters.z) ||| float.IsNaN(opticalCenters.z) ? 0 : opticalCenters.z;  
float rightY = float.IsInfinity(opticalCenters.w) || float.IsNaN(opticalCenters.w) ? 0 : opticalCenters.w;  
newPosition = new Vector3(rightX, -1.0f \* rightY, plane\_distance);  
}  
else  
{  
newPosition = Vector3.zero; // Just in case  
}

```auto
canvas.transform.localPosition = newPosition;

```

After fixing the code, the right eye displays correctly. But now I have a new problem: the image from the camera in oculus is stretched and the body and objects are seen much lar  
ger than they really are. Is there any way to tweak the resolution settings for a more realistic video view in the headset? What should I do to make the image not so stretched horizontally?

 ![Снимок экрана (30)](https://community.stereolabs.com/uploads/default/original/2X/e/e27c861189a9e2ffff1c16bc613e20c934a2372e.jpeg)  
 ![Снимок экрана (31)](https://community.stereolabs.com/uploads/default/original/2X/a/a31a017946e1b3ea2c6fb3ef1524176b569c2c55.jpeg)  
 ![Снимок экрана (32)](https://community.stereolabs.com/uploads/default/original/2X/1/1aabf73fa65f959ceebeb93710762b2436b6e26f.jpeg)  
 ![Снимок экрана (33)](https://community.stereolabs.com/uploads/default/original/2X/8/8f78f096a2015314bbac1b5eacb0e424bbadf6df.jpeg)
