Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Detect if Child RectTransform is larger than Parent?

Discussion in 'UGUI & TextMesh Pro' started by DRRosen3, Oct 22, 2023.

  1. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    Title says it all. I'm looking for a way to find out if a child's RectTransform is larger than (extends outside of) it's parent's RectTransform.

    The specific scenario is that I have text that will scroll itself. However, I don't want it to scroll, if it doesn't need to. It should only scroll if the child's Content Size Fitter has made its RectTransform so large, that it extends outside of the parent (who has a Mask).
     
  2. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683