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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Bug Possible bug, why would this line cause a "Screen position out of view fustrum" error?

Discussion in 'Editor & General Support' started by The702Guy1, Jan 25, 2023.

  1. The702Guy1

    The702Guy1

    Joined:
    Apr 24, 2022
    Posts:
    45
    So for the last hour I've been researching how to fix the the following error:

    Screen position out of view frustum (screen pos 761.666626, 770.666626) (Camera rect 0 0 1920 1080)
    UnityEngine.SendMouseEvents:DoSendMouseEvents (int)

    I tried all of the things people said from closing and reopening scene tab, deleting auto generated camera, check camera size/clip plane etc and nothing worked. I found the line of code causing the error but it makes no sense as to why it would cause this error because it has nothing to do with the camera. I don't have any code in this project that affects the camera behavior and I am using a cinemachine brain attached to my main camera.


    Code (CSharp):
    1. void setRigidBodyState(bool state)
    2.     {
    3.         Rigidbody[] rigidbodies = GetComponentsInChildren<Rigidbody>();
    4.  
    5.         foreach (Rigidbody rigidbody in rigidbodies)
    6.         {
    7.             rigidbody.isKinematic = state;
    8.         }
    9.  
    10.         GetComponent<Rigidbody>().isKinematic = false; //this line is causing the issues
    11.     }
    This method is called in start to set all of my ragdolls rigidbodies to kinematic or not depending on ragdoll state. I don't want the main rigidbody to ever be set to kinematic in either case which is why that last line is there. Any idea why that line would cause a camera error?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    32,353
    You aren't changing the Camera.rect property to (0,0,1920,1080) are you?

    The max should be (0,0,1,1) - it's normalized to screen coords
     
  3. The702Guy1

    The702Guy1

    Joined:
    Apr 24, 2022
    Posts:
    45
    I have not made any changes to the camera at all aside from adding a cinemachine brain to it. Upon further messing with it, it actually seem like it may have something to do with the animator but I'm not sure what yet. When I set kinematic to false so gravity can be applied, the error will pop if the animator is enabled but won't if it is disabled. Not sure what in the animator would be causing that but I have a character fbx that was exported out of blender with mixamo animations. What I've gathered is that it has something to do with the character falling with gravity while animations are playing and that is popping the camera error.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    32,353
    Look at what properties are being animated. Maybe something is having its scale set to zero or something else that results in degenerate math at the matrix level.
     
  5. The702Guy1

    The702Guy1

    Joined:
    Apr 24, 2022
    Posts:
    45
    I will take look into that