Search Unity

Bug Screen position out of view frustum

Discussion in 'Scripting' started by Lekret, Nov 21, 2022.

  1. Lekret

    Lekret

    Joined:
    Sep 10, 2020
    Posts:
    358
    Full error message:
    Screen position out of view frustum (screen pos 960.000000, 540.000000) (Camera rect 0 0 1920 1080)
    UnityEngine.Camera:ViewportPointToRay (UnityEngine.Vector3)
    Code:
    Code (CSharp):
    1. var ray = camera.ViewportPointToRay(new Vector3(.5f, .5f, 0))
    What am I doing wrong?
     
  2. Lekret

    Lekret

    Joined:
    Sep 10, 2020
    Posts:
    358
    Ok, I found the problem, the player was going too far from the origin to some crazy big coordinates.