I built a map generator that takes random walks and lays down tiles, and then adds walls along the borders. While testing, I discovered a “leak” along all the walls that required rotation. (The northern walls, aka spawned with no rotation, are fine). All the other walls (the ones that require rotation) have this issue.
On inspection of the walls, I discovered that it seems they have all been scaled down ever so slightly (probably to something like 99% of their original size). This also occurs on a different mesh I use as a “corner” piece to fill in the gaps for outside corners.
Don’t worry about the perceived weird angle in the top right of that image, that’s Z-Fighting as the green portion here is for developer purposes only. As you can see, the mesh instances don’t go all the way to the edge, despite being specifically designed to do so.
Some information about the mesh:
Built in Modo:
Size: 512x512x16 (they should be flush with the borders of each “cell”)
Required a 270 degree rotation on the X axis in import settings.
The pivot point lands where the center of each “cell” would be.
Some information about the setup:
Each cell is a 512x512x512 area.
Construction script takes a random walk of n steps, and assigns values to an array of vectors (0,1,0 etc).
Each element of the array of vectors is eventually multiplied by my grid size (512) and plugged into a transform.
When necessary, I use a custom built function “Instanced Rotation” to avoid an issue where the walls originally rotated around the world origin.
Here is the code for “Instanced Rotation”:
All it does is break the transform out into it’s parts, then makes a new transform while keeping the location, and changing the rotation based on the value I feed it.
So is this a bug with transforms/rotations in UE4?
Am I doing transforms wrong? (Certainly possible I created a function that appears to work but screws with scale somehow.
Is this a problem with my export settings in Modo, or my import settings in UE4?
I seriously doubt it’s the latter two, as the northern walls (with a default rotation) are completely flush. It also doesn’t seem to be a problem with my “Instanced Rotation” function, as I applied the same function to the northern, 0 rotation walls and they’re still fine.
Any help would be appreciated.