Search Unity

Question converting object location data to object size data ito screen

Discussion in 'Scripting' started by barbrian1, Feb 11, 2024.

  1. barbrian1


    Jan 24, 2024

    is there any way to convert, calculate, or approximate an object's location data into the object's size relative to / in terms of the camera and screen, over and above empirical trial and error of course.
    i have an object, not necessarily the primary object, but a secondary object. i know its location data relative to the screen. as part of rendering, i want to know how much of the screen the object is filling / occupying at a given point in time. any way i can do this? even a percentage value would suffice - i.e. knowing the object has a clout of, or is filling, x % of the total screen