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

Unity UI [SOLVED] Clamp Rotated Rect to Fill Parent (AspectRatioFitter that works with rotation)

Discussion in 'UGUI & TextMesh Pro' started by jschieck, Jan 5, 2018.

  1. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    429
    I'm attempting to create a custom Aspect Ratio Fitter that works when the RectTransform has rotation. Essentially I need the EnvelopeParent functionality, but force the rect to stretch to fill no matter the Z rotation of the transform. Having trouble coming up with a solution. Anyone tackled this before?

    upload_2018-1-5_9-55-50.png
     
  2. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    429
    Nevermind figure it out.
     
  3. Heykinox

    Heykinox

    Joined:
    Sep 28, 2013
    Posts:
    4
    How?
    I have the same problem
     
  4. Heykinox

    Heykinox

    Joined:
    Sep 28, 2013
    Posts:
    4
    I was able to fix this problem by putting my aspect ratio fitter into a parent that is in the same direction (up points towards the same up). When the AspectRatioFitter and its parent are in the same direction, it seems to be working properly.
     
    ROBYER1 likes this.