Misplaced Instanced Static Mesh
I wasn't quite sure what to name this as the issue is rather peculiar to say the least. I've made a generator which generates a grid of instanced static meshes(using the hierarchical one so I can use the cull distance later if needed).
However, there is always one instanced static mesh that is misplaced, put inside my "walls". I've gone through my math several times and it shouldn't be happening. What's even more peculiar is that sometimes it will randomly disappear when that one instance goes out of view.
Also, if I enter debug camera mode - it will disappear right away. Any ideas as to what might be going on here?
I'm on 4.12.3.
Video Example: https://streamable.com/ms60
The grid of interest is the green one at the bottom left.
After taking a look at your project it appears that your issue stems from the "Empty spaces" that you are providing to the instanced meshes. If you run a check to see if the vectors that are given are within the "emptyGridVectors" array, you will find that some of them are not within the array. I have provided an example below on how I was able to workaround the issue. You could use this method if you want, however you may want to take another look on how you are placing your instanced meshes. I hope that this information helps.
In this example I check to make sure that the values that are passed to the instanced meshes for their location are within the array. This is done by making sure that find item does not return a -1.
Make it a great day
answered Jun 30 '16 at 02:13 PM
Rudy Q ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here