ClipDescendants not working with UI with Scale size/position

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’m trying to make a healthbar with ClipDescendants, but I can’t get it to work without making it offset (which would make some screens have a strange looking healthbar which is either too big or too small to see)

  2. What is the issue? Include screenshots / videos if possible!
    I’m unable to scale my GUI’s properly because I have to use offset for Clipdescendants to work
    (With Offset, on my normal studio viewport size)
    https://gyazo.com/014d12cde37b5b79926efe5fc93cfd04

(With Offset, 1920x1080)
https://gyazo.com/0859d934d29873cc3779d5fa531fda12

And, this is how I have my explorer setup
image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried all solutions I can find, nothing has worked

What I’m looking for is a way to properly scale my actual health bar to fit in the image, without using offset

Hi, late response! I hope this helps you in case you never figured it out.

You can combine the usage of scale for the bar holder frame and use AbsoluteSize to calculate the offset in respect to the barholder frame.

Here’s example code I used to make a tweening time UI.

In my example ClipFrame = barholder
MainGui = Outside
Greenbar = bar

So you can cross reference it with what your setup looks like.

	local Percentile = (MaxTime - CurrentTime) / MaxTime
	self.ClipFrame:TweenSize(UDim2.new(Percentile, 0, 1, 0), "Out", "Linear", 1, true)
	self.GreenBar.Size = UDim2.new(0, self.MainGui.AbsoluteSize.X, 0, self.MainGui.AbsoluteSize.Y)
1 Like

Thank you, I will try this! I’ve had to use square bars for the time being.