UI: Does having a child tween the parent affect the tween process in any way?

So I was scripting some UI in my obby earlier today and I wanted to make it so that when a image button was hovered over the size would become bigger/smaller really haven’t decided yet. So I did a basic script using MouseEnter.

Then thinking ahead I did the same script but with MouseLeave and this time I made it so that when the mouse left the button size would go to small again, note this script is a child of the button.

Then I tested the game and I realized that the button’s background was too big and even the slightest mouse movement could trigger the tween. So I thought of a workaround and entered an empty text button with a transparent background and tweaked the scripts so that now the tweens would b triggered by the textbutton instead of the general button, but here is the thing, when tweaking I just tweaked the line where the game would identify what entered and left does what and even though now the tweens were affected by the textbutton they affected only the imagebutton.

Then I tested the game, for the most part it seemed to be working fine but when I entered and left with my mouse button simultaneously and quickly it just sometimes froze and then resumed tweening after I entered and left slowly again.

I thought this was weird so I opened a baseplate and just quickly ran the same script on a textbutton though note this textbutton did not have a child that triggered the tweening, then I tested the baseplate and weirdly enough it was tweening perfectly fine even when I was entering and leaving at the speed of light.

So my question is pretty self explanatory, does having a child trigger the tween affect the functionality of the tween? (If this turns out to be a bug, well then just tell me xD) very confused right now should this be happening?

Have a nice day and stay safe guys!
-pr

Yes, it triggers, since you changing a size of Parent, it would change a size of child.

1 Like

I’m really confused…

Can you provide some screenshots and code examples to help make a little more sense what you are trying to do?

Changing the size of a BaseGUI will not always change the size of it’s descendants. It depends whether the descendants are using the Scale or Offset properties of Size.

Im pretty sure he using scale, btw he could add delay and cooldown for size tweening to prevent this weird things.

It’s wrong to automatically assume he us using Scale, different people make UIs different ways. I personally have made many UIs that are all Offset and some that are all Scale. It really depends on the situation, so it would be good to understand what he is doing before trying to solve it (possibly incorrectly).

1 Like

hold on, I think I have a solution. I will take out the textbutton child

Also try set anchor points if it wont work. Btw you can add function to gui from everywhere. Just do a directory to gui object.

I set anchor points but nothing seems to work

Can we get a video? Would be very helpful

1 Like

I will try to provide one thanks for your help

No problem, i will wait for it. Also if i dont reply it means im making homework.

1 Like

I assume that’s supposed to mean doing HW xD thanks

Lol ok so after about 30 minutes of dissecting about 300 lines of code and slamming my head into the wall for about 10 minutes I have found the issue and I have fixed it thank you everyone who tried to help.