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

How do you find out what size a part is in if statements?

Asked by 6 years ago
Edited 6 years ago

Is it like this?

if part.Size == Vector3.new(5,5,5) then

OK, so I just figured out that sometimes this works and sometimes don't, because the size of a part usually goes up and down very very very slightly sometimes, so how do you prevent it?

For example: A big part with the size 500,1,500 can sometimes become 500,1.00000000005,500 and yeah... that's really annoying

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago

The same way you might compare two part positions. They likely won't be exactly the same so check an arbitrary distance.

if (part.Size-Vector3.new(5,5,5)).Magnitude < 0.1 then
Ad

Answer this question