Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i get the brick's size in numbers, and only the x and z (no y)?

Asked by 9 years ago

I am making a gui where the size of the frame changes as the size of the block changes. How would I get the size of a block, and only the x and z?

frame= Instance.new('Frame')
frame = script.Parent.Size.X * 2
frame = script.Parent.Size.Z * 2

please help!!! Thank you!!!

[EDIT] I realized that ******.X or Z isn't possible, is there a way to just get the first number and the third number?

0
Actually, it is possible. You just need to use UDim2 values. Also, you can scale the frame instead of getting the size, since it's much easier. aquathorn321 858 — 9y

2 answers

Log in to vote
0
Answered by 9 years ago

Frames use something called a UDim2, not Vector3. When you want to find the x value, say frame.Size.X. This returns a UDim, which has a scale and offset property. If you're using the scale (the first number, goes from 0.1 to 1), say frame.Size.X.Scale, for offset frame.Size.X.Offset. You can also do the same thing for the Y axis.

If you're looking to resize your frame (kind of like using BodyPosition), check out:

http://wiki.roblox.com/index.php?title=Tweening

How to use UDim2's to manipulate size:

http://wiki.roblox.com/index.php?title=UDim2

0
This kind of helps! thank you! I found out the problem though, thanks! yogipanda123 120 — 9y
Ad
Log in to vote
0
Answered by
iFlusters 355 Moderation Voter
9 years ago

There's n arrow next to 'Size' in the properties of the brick, click that and it. will give you the X, Y, Z cords.

Answer this question