Scrollbal size going beyond the UI canvas.

Forum Archive Scrollbal size going beyond the UI canvas.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8096
    wysepka
    Participant

      When changing size in Canvas scrollbar properties, my HealthBar going far beyond the expand. Dont know what possibly could go wrong,

      #28149
      Jonathan Gonzalez
      Participant

        Sometimes it’ll scale into a negative value. Maybe something isn’t properly lined up within your UI elements so any scale adjustment multiplies the effect for the children elements as well. 

        #28150
        Jonathan Gonzalez
        Participant

          I didn’t want to leave you with a bit of a vague answer, so I recreated this in Unity 2018. It can be a bit of a pain as the UI can sometimes readjust and you’ll need to re-parent things at times. Here is the link to the completed scene: UI Health Bar

          Key things to look out for, make sure the anchor point is to the left of the canvas (pinwheel looking icon) for the health portion of the UI. What I would do differently than in the video is to create the mask and health and keep them separate, then add the scrollbar to the canvas. Scale the mask and health to match the entire size of the canvas, move the anchor point of the health to the left, then move the health under the mask as a child. From there adjust the mask group to look like a health bar. 

          It’s more complex than it should be, usually I use a simpler method which just involves using a health bar image and adjusting the fill type of that image. Take a look at this lesson to find out how I do it now: https://cgcookie.com/lesson/loading-bars

          #28151
          wysepka
          Participant

            Thank You !

          Viewing 4 posts - 1 through 4 (of 4 total)
          • The topic ‘Scrollbal size going beyond the UI canvas.’ is closed to new replies.