I’m not even spawning the original components at all. at this point my “foliage spawn code” is hooked directly in (and only in) my random dungeon spawner code, which spawns prefabs (by spawning each actor that compose each prefab). it checks if the prefab’s actor-to-be-spawned has a mesh that’s in the foliage list and if so it skips spawning it and simply adds it to the foliage PerInstanceSMData. atm this means I still don’t get RB collisions, but the foliage spawning code works because if I use ‘show instancedstaticmeshes’ it only hides the foliage-meshes and there’s no other meshes in their place. before I call it a dead end I’ll investigate more about my increased drawcalls because something definitely feels off and at least I want to have a real comparison.
I also tried adding multiple parking lots with maximum cluster size (a grid of 6x6 in the editor). while the editor tells me I have 36 clusters, when I add the meshes through the code they seem to all go into the same cluster because despite being far off in the level they still all get culled together (while I can see the parking lot meshes get culled independently). As far as I could see there’s no way to indicate which cluster a mesh gets assigned to. The system won’t seem to do it automatically based on the location, and the only way to update clusters is through native code which only gets called from the editor. Or did you maybe find a way to assign meshes to specific clusters?
yes the foliage seems to have a bug (also in UE4) where hiding it still makes it cast shadows. yours seems like a good solution to get some performance back ![]()