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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Responsive instantiated UI

Discussion in 'Scripting' started by Neriad, Nov 28, 2019.

  1. Neriad

    Neriad

    Joined:
    Feb 12, 2016
    Posts:
    125
    Hello guys,

    Theres something I've been struggling with for a while now, there are elements that I want to show at the borders of the screen if they are beyond the screen view.
    To picture, I have enemies, and if they are not in the camera view, I have a element pointing in their direction and it cannot go further the screen.

    This works for my ScreenResolution reference but it does not work for all other resolution. Basically, I need to have the correct max anchored position for x and y for the current resolution.

    Anyone knows ?
     
  2. Neriad

    Neriad

    Joined:
    Feb 12, 2016
    Posts:
    125
    Nobody ?
     
  3. VSM2018

    VSM2018

    Joined:
    Jun 14, 2018
    Posts:
    16
    Post your working code here, it gives a better understanding of what is happening there.