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:
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.
answered Feb 19 '19 at 04:27 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here