Vector3 behaving weirdly

offset = Vector3.new( block.Size.X % 2, block.Size.Y / 2 ,math.clamp(block.Size.Z - 3 , 0 , math.huge) + 0.5 * block.Size.Z % 2)

All of these methods give the same result despite being different equations that should give different results.
When the part measures 1 unit on every axis, offset equals 0.5,0.5,0.5
When the part measures 2, offest equals 1,1,1
When it measures 3, offset is 1.5,1.5,1.5
But when the part measures 4 units, offset equals 0,0,0 despite the fact that it should be 0,2,1

It’s not a problem with Vector3 but with the rest of your code. For me it works.

1 Like

Modulus returns the remained of the division of one number by another:

10 % 2 = 0
8 % 2 = 0
6 % 2 = 0
4 % 2 = 0
2 % 2 = 0

Vector3 isn’t really behaving weirdly in this case, it’s just the equation you supplied that returns static values

Yes but if the part’s size is 3 it should return 1, it returns 1.5, not only that but block.size.Y returns values that are flat out wrong.
I made another script the exact same and it works now smh my head.
Yup it works now

Did you enable the Native Vector3 Type Beta? Or enrolled in Beta Channel? That could probably be why. If so, please report the issue on this DevForum post.

2 Likes

That is not the problem. That update only improves back-end performance. It does not change the way they work at all.

Oops, i just realized i had a part that kept updating offset´s value wrongly .-.

1 Like