[Bug] Z Scale in BoxZones
zf-development opened this issue · 2 comments
Hi, I've observed that the scale in the boxzone doesn't work.
Currently, I was this BoxZone's code.
BoxZone:Create(v.outdoor, 2.0, 2.0, {
name = tostring(_ .. 'outdoor'),
scale = {0.75, 0.75, 0.35, 0.35, 0.25, 0.75},
debugPoly = true
})
The BoxZone that's created is way bigger in height that was is supposed to be.
Thanks for information/fix.
So a couple of things are going on here. First of all, you don't have a minZ and maxZ in the options of your BoxZone:Create
call, so what you're seeing here is actually not a bug, but intended behavior. When the minZ and maxZ are nil on a BoxZone, the BoxZone stretches to infinity on the Z axis. To be clear, the 2.0, 2.0
you are passing to BoxZone:Create
are the length and width of the BoxZone. The scale
option is not the size of the zone, it multiplies the size of the zone.
In general, if possible it's better to set your length and width (2.0 and 2.0 in your case) and your minZ and maxZ to the final values you want, rather than using scale/offset to tweak them. The PolyZone creation commands (https://github.com/mkafrin/PolyZone/wiki/Using-the-creation-script) are useful for this, as they allow you to tweak the position, length, width, and height to exactly what you want, without needing to use the scale or offset options.
At the same time, funnily enough, scale and offset on the Z axis was indeed broken for BoxZones, so even if you had added those options, it wouldn't have worked. I have fixed this in commit bf91307.
To get this fix, you can download the latest release (https://github.com/mkafrin/PolyZone/releases/tag/v2.6.1) and also add minZ
and maxZ
to the options you are passing to BoxZone:Create
. For reference, these options are mentioned here.
I'll leave this issue open for the next day if you have any additional questions.
Thanks for the informations. Quick responses you are the best 💖