I do not know if this is my fault or engine bug because I am new to Unreal.
I’ll post it to a bug report topic, but if it’s wrong, please just point it out.
Steps to reproduce
- Create Instanced Static Mesh Component, and Call Add Instance function to creates multiple items. Let’s say 5.
- And call Remove Instance to delete what’s in the middle.
Let’s say 2. The middle is removed.
- Add new instance. I just added and it is successful, but the last instance is lost.
No, it looks like it’s been removed, but it’s still there. Collision occurs,
I just can not see the mesh.
At this point I noticed that the contents of the UInstancedStaticMeshComponent::InstanceReorderTable array are as follows:
0:0 (index:instanceIndex) / 1:1 / 2:3 / 3:4 / 4:4
I think this value should not be duplicated, but I’m not sure.
- And remove the instance I just added.
Start with 5, remove 2, add 1, so it should be 4. But the result is three.
(and one invisible mesh)
I may be totally wrong about Instanced Static Meshes. Is it an unacceptable behavior to remove instance in the middle?
However, the official document does not say such a thing, I searched the forum, but there was no related comment.