Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Screen position out of view frustum

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

  1. Lekret

    Lekret

    Joined:
    Sep 10, 2020
    Posts:
    272
    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:
    272
    Ok, I found the problem, the player was going too far from the origin to some crazy big coordinates.