Search Unity

Question How to make RenderTexture precise

Discussion in 'Audio & Video' started by CptHavvock, Dec 1, 2022.

  1. CptHavvock

    CptHavvock

    Joined:
    Dec 30, 2021
    Posts:
    12
    So in order to make a recursive world (going to the right teleports you seemesly into the left) I put one quad and camera on each side, that display the other side. That worked pretty well, but I can't help but notice that the ground sprite doesn't align with what the rendertexture shows.

    The problem is that it initially works and they both seem to be perfectly matched, but when my character jumps (I've set it so that both the camera and the quad always follow the Y coordinate of the player), it will most likely than not appear misaligned once it hits the ground.

    The code that the camera and the quad follow is this:
    lCam.transform.position = new Vector3(-5.0f, -0.205f + Player.transform.position.y * 2.0f, -10.0f);
    ; the reason for the "* 2.0f" being that the size the side camera has is double than the size of the main camera.

    It won't always happen: sometimes it keeps on being aligned, but other times it looks just like in the image below, with no special condition for it to happen.

    So my question is: is this a problem with how renderTexture renders the camera, or might I have done something wrong? Can it be fixed or configured?
     

    Attached Files: