Unable to Get Collision on Instanced Static Meshes

Hello,

I am currently running into an issue where I’m unable to get collision at all on instanced static meshes (working in UE5.1), where I’m using them to create a grid of hexagons from a blueprint as the basis for a terrain system. I’ve set the collision presets within the static mesh, the instanced static mesh component within the blueprint, and the blueprint itself to all have collision enabled with the world dynamic object type and to block everything including the trace channel I’m using, but am unable to get any form of collision on the instances.

There is collision on the mesh itself and I’ve tried replacing it with simple collision as well as creating custom complex collision but it does not appear on the instanced meshes. I can see the collision working on the mesh if I place it in the map, which leads me to believe it’s something with the instancing. Because of this I’m unable to get the terrain system working with collision as well as get trace results to continue working with manipulating the individual instances.

If I use the “Get Instances Overlapping Sphere/ Box” nodes I am able to get the index results of the instance array, however this is a lot harder to work with than a trace as there’s no debug visualization or the same hit output results that I’d like to use, and it returns an array instead of the single index I need and seems to be a bit inconsistent in its results.

Has anyone happened to have run into this problem before, or know a solution? Thanks very much for your time and help in advance!



Does the mesh actually have simplex collision? I don’t mean did you set it to ‘project default’, I mean can you actually see the green wireframe in the static mesh editor when you turn on collision visualization.

Yes the mesh does seem to have both simplex and complex collision. I did enable “Use Complex Collision as Simple” in this case as well. I’ve tried removing collision and re-adding it with a simple box collision as well as custom complex collision but it does not update on the instanced grid. I can however see the collision updating on the mesh placed individually in the map when I make these changes.

Ok, and to be clear, are these ISM or HISM? ( oh I see, ISM ).

Can you try it with a cube? ( It works immediately for me with a cube ).

I would keep it on simplex only, I seem to recall complex doesn’t work with ISM.

Yes, it’s all done through an instanced static mesh component within the blueprint. Ah that’s good to know that complex collision doesn’t work with ISM, I’ve set it to use simplex only now. I tried replacing the grid mesh with a standard cube from the engine content that does have simplex collision, as well as several others and still couldn’t get collision to appear on the grid. It might be something that I’m doing in the blueprint that is causing the issue then? However, I’m not changing anything related to physics or collision at any point in the blueprint so I don’t quite know what it could be.

I have also tried at various points in the construction script to force enable collision and blocking on all trace channels, or to disable and then enable collision but it still does not appear in the generated grid. Thanks again for your time and help so far!

I only did this

and got collision.

How does your code differ?

I think the biggest changes in my code are likely the following:

  1. I’m using the “Fast Noise Generator” plugin to get procedural generation applied towards the hexagon mesh world Z positions via a custom data value per instance.
  2. I’m using two “For” loops to create the grid from an instanced static mesh component already created in the blueprint and the “Add Instances” node.
  3. I’m using “Update Instance Transform” at the end of the construction script to apply the change in world Z position to each instance.

I’ve uploaded the entire construction script code here: BP_HexGrid Construction Script posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Why are you adding instances and child actors?

In any event, you can explicitly set the collision on the ISM

image

does that help?

The child actors setup was for early testing, and so that I could prove the performance benefits of the instanced grid vs a grid of individual actors in my current project work easily through a simple Boolean variable change in-editor. It shouldn’t actually execute the child actors setup code unless the Boolean has been set to false. I am planning on removing that in the future but haven’t gotten to it yet.

Unfortunately explicitly setting the collision on the ISM component doesn’t seem to change anything in the generated grid. I have tried placing that code at various parts of the construction script to no avail.

1 Like

The only thing I can think of is to make a minimal project and give me a link. I’ll take a look ( PM me if you like ).

Did you find solution?