Instanced Static Mesh gets scaled

So, I added a InstancedStaticMesh(ISM) component in a BluePrint(BP). Then I added four of them using a for loop and Add Instance node, in a “circle”. But to my “horror” all but every fourth, including the first, instance gets scaled about 0.0005(what it looks visually) on X and Y axis.

https://puu.sh/sZ096/1314059821.jpg

So first I of course thought that it was just the mesh that was wrong, and went and checked, sure it was off a little bit, but not this much. But I fixed it anyway, making sure it was on the right place down to the max zoom I could get in the 3D app. No change. And if I add the mesh manually, IE not as ISM, it works perfectly.

Even tried with a new mesh, a perfect box moved so its corner was at the pivot, no change, same problem with ISM. Tried another version of the Engine.

Went on Discord and we went trough it thoroughly but others got the same error.

So I am guessing its a bug, maybe some float error, or memory thing. We tried to check the transformation of the Instances after creation, but they checked out just normal.

So, the first Instance gets the right scale, same with every fourth, I guess that it works as long as it has the same rotation as the original, but all other is a bit off.

Alright, so I found another bug with Instanced meshes.
If you scale them to anything other than n+1/2^x the scaling wont match the real size, therefore you will get holes between meshes that need to match up completely, like a floor. As seen in the picture the error gets bigger the integer scale compared to the decimal scale(other than 1/2^x).

https://puu.sh/tbUC9/507f8239e0.png

A work around is to put the pivot of z-axis in center of mesh and mirror the scales to get the same visual effect. Like this: 1st (scale) [1 1 1], 2nd [-1 1 -1], 3th [1 -1 -1] and 4th [-1 -1 1]. By mirroring two times you neutralize the inverted faces that you otherwise get when putting negativ scale on ISMs.

Still needs attention though.

Hello tsuzumi,

Thank you for your report. Another user reported an issue related to this about a week ago and I entered a bug report for that which you can find here: UE-40476 Unfortunately, despite this issue’s prevalence, it’s been decided that we do not have the resources to work on this at the moment. I can say that the original scaling issue you reported should be able to be fixed by using higher values of the same rotation, such as using 540 in place of 180.

Any chance of getting this fixed? I’m building a warehouse full of instanced shelf pieces. The piece oriented like the above user are very slightly off on mine too but only when using instanced meshes.

Unfortunately the statement I made previously still stands, the designers have decided that we will not be allocating resources to fix this. It would likely cause other issues which would lead to more things needing to be fixed. Please try the workaround that I provided above. I hope this helps.

Hi Matthew,
We’ve experienced similar issues. We’ve tried the 540 workaround you mentioned but that does not appear to work on instances.

Hello, I apologize for the delay. I will look into if this workout is still working on my end. If not, I’ll speak to the developers in charge of this section of the engine to see if they would be willing to look into a fix for this, since the workout around is no longer valid.

From testing this in 4.19, the workaround is still working. Could you provide a scenario, preferably via a test project, where this workaround does not fix the issue? Here is the project that had the reproduction for the bug report: ScaleBug. You can see the difference by setting the Transforms in the New Blueprint to either 180 or 540 and compiling the Blueprint.

Please use that to compare.

Hi Matthew,

Thanks for this. I’ll try to find the time to re-create our issues in your test project. However this may take some time as I’ll need to get a separate vanilla UE and find some time to replicate this between tasks.

Hi Matthew,

I have the same issues with Instanced Static Meshes. The “n * 360 + 180” workaround is working. But for 90 or 45 degrees rotation I cannot find anything that works. The n * 360 + 90 workaround is not working.

Hello Unreal Dev team.

Two years have past since this problem was found, and a year since last update. Any fix in sight yet?

I think that quite a few people might have to find other solutions than using (H)ISM for reducing draw calls on big scenes with many similar tiling objects. Just as in my original case.
Would love to be able to use this.

Same here, we also can’t get it working with the rotator (X + 360, Y + 360, Z + 360).

@Matthew, is there any solution we can use or we should just forget ISM as-is?

Hi @Matthew J, I reproduced the bug and as you can see here scaleBug in that case the work-around does not work. Am I doing something wrong?

Facing the exact same issue. Trying to create walls using cube meshes but unable to perfectly fit the edges to each other because the scaled meshes have incorrect sizes.

Bumping this in hopes that someone sees this and can give a workaround or fix for this.

1 Like