Trying to use Frame.Size.Y.Scale gives error

Basically, I’m trying to make a drop-down menu so that when you hover with your mouse it expands. I want to use tweening, but since I couldn’t find a way I decided to use Frame.Size.Y.Scale as it works completely fine in studio. However when I hover with my mouse I get an error stating:

" Scale cannot be assigned to - Client - DropDown:12
20:12:24.261 Stack Begin - Studio
20:12:24.261 Script ‘Players.tomsterBG.PlayerGui.Settings.Frame.Measurement.DropDown’, Line 12 - Studio - DropDown:12
20:12:24.262 Stack End - Studio"

If you have an idea how to use either tweening or scale to make my drop-down work please help!

Can you share your code maybe?

1 Like

There you go

It’s a read only properly, you can’t change it like how you are doing, you can need to assign an UDim2 to the size

Example

dropFrame.Size = UDim2.fromScale(dropFrame.Size.X.Scale, 3)
2 Likes

Can you tell me more about UDim2? I’m pretty sure that I have literal to no experience with it

UDim2 is basically the Vector3 of GuiObjects. You use it for Sizing and Positioning a GuiObject.

There’s 3 ways to make an UDim2, new, fromScale and fromOffset

https://developer.roblox.com/en-us/api-reference/datatype/UDim2

1 Like

Mind telling how would I apply a tween to it, or is it not applicable in this case?

Do you want to tween the size by any chance? You can use the regular methd of TweenService and just changing the Size property, or use the built in TweenSize of GuiObjects.

Creating an UDim2 is like how you would create a Vector3, you just have to different arguments to give

1 Like