I’ve run into an issue where adding and removing instances from the foliage instance static mesh component is crashing the editor.
I have two foliage types, Tree_Oak_03 and Tree_Oak_03_Snow.
I have a weather system which affects a certain radius on the map and changes from summer to winter and vise versa. Map defaults as summer.
The trees within the weather system radius are switched out depending on which season it is.
I’ve painted a handle full of Tree_Oak_03 on the map using the Foliage Mode.
I painted Tree_Oak_03_Snow as well but deleted all instances. I painted the snow version so that a foliage instance static mesh component was created for that type.
A couple of test cases I’ve created:
1.
- All instances of Tree_Oak_03 are within the weather system radius.
- No Tree_Oak_03_Snow instances exist
If all the trees are within the radius of the weather system, the editor doesn’t crash and all trees are swapped to the snow version. I can then reverse the process and change them back to Tree_Oak_03. I’m able to repeat that entire process multiple times over.
- All instances of Tree_Oak_03 are within the weather system radius ( minus one that’s outside the radius )
- No Tree_Oak_03_Snow instances exist
If just one tree is outside of the radius of the weather system, all trees except that one are switched over to Tree_Oak_03_Snow. I reverse the process and change them back to Tree_Oak_03. No problem.
However, as soon as I attempt to switch to winter a second time is when the editor crashes.
It looks like the issue occurs during the ‘remove instances’ node when removing
Tree_Oak_03.
- All instances of Tree_Oak_03 are within the weather system radius ( minus one that’s outside the radius )
- One Tree_Oak_03_Snow exists outside of the weather radius.
During this run, the trees switch to winter no problem, but then crash when switching to summer.
- Same example and outcome as #3 but the one Tree_Oak_03_Snow was within the radius.
Anyways, I can’t for the life of me figure this out and would love any help.
The weather system BP Function