Set Collision Response on Instanced Static Mesh at Runtime

I have a custom trace channel (“Interact” in the image below), defaulted to ignore. At run time, I want to change certain instanced static mesh components to block the channel. Using the “Set Collision Response to Channel” node seems like it should work–and indeed, “Get Collision Response to a Channel” returns “Blocked” after executing the node (and “Ignore” before executing, as expected). So it seems like everything is working properly; but then a SphereTraceByChannel using the custom trace channel does not actually hit the instance. It works as I expect with static meshes, and the trace works with instanced static meshes if I set the collision in the editor rather than at run time. I was able to reproduce this in the default top-down template.

Starting the level with everything set to ignore the channel, executing “Set Collision Response to Channel” on both the static mesh (cube) and the instanced static mesh (sphere) results in hitting the static mesh but not the instanced static mesh:

268441-hit.jpg

Is this intended behavior for instanced static meshes? If so, why does “Get Collision Response to Channel” not match the actual collision behavior? Is there any way around this?

In case anyone else wants to accomplish something similar, here’s the workaround I’ve settled on for now:
I duplicated the instanced static mesh component for the actor, setting the altered collision settings as desired on the duplicate component, and then whenever I want to update the collision settings I instead add an instance of the duplicate ISM using the transform of the original ISM, and remove the instance of of the original ISM.

This appears to still be the behavior even as recent as 4.26, whether a bug or intentional.

As an additional workaround that may be simpler, disabling and enabling collision on the instanced static mesh seems to updated the collision response. I’ve only tested it with trace channels and not full collision, but expect it works to fix that as well.

332170-workaround.png

1 Like

This is still a thing in UE5.0 is someone else wonders…
Thanks for posting this, i started to lose my mind… :smiley: