Change collision presets through blueprints

Hi all,

So as the title says, is there a node that can change the collision presets of an actor?

For example change an object from overlap all to block all, or vice versa.

Is this possible?

yes, you can change collision for certain channel

There is a node for that - check this documentation

4 Likes

Thanks, though I don’t really understand what these Enums represent.

2 Likes

If you would like to change the Collision Preset of an actor / static mesh through Blueprints, I found that “Set Collision Profile Name” does the trick. In the name input you write your Preset name by hand, make sure not to misspell.


– Change the Col Preset seen in the right of the screenshot above, but through BP –
Screenshot 2022-06-17 093446
– Use this –

You can also make your own Collision Presets in the Project Settings tab.


Which is how I did the custom “RoofCamIgnore” seen in the shots above.

In my case I wanted this because I wanted to change the Collision Preset of a Static Mesh only during an interaction, then when said interaction is finished, I wanted to put the Collision Preset back to what it was. Illustrated in here:

(I save the initial Col Profile into a parameter for save keeping and for use when interaction is finished).


Random tip from what I just did in my project though, would be to ask yourself first if you really need a new Collision Preset / Profile and if you really need to be changing to it.

In my case I was casting a ray with Trace Channel Camera and had the issue of wanting to change if said trace is blocked or not, on the go, through BPs.
First way to do it was to make my custom Collision Preset and have it always be “Camera Trace Response: Ignore” (which is why I created “RoofCamIgnore”).
But that is needless because, just like in the first reply you got, I could just use “Set Collision Response to Channel” node
Screenshot 2022-06-17 094718
and in new response put “Ignore”.
Then whenever I want in that same BP, later on, call another Set Coll Response, and this time go with New Response: Block, which essentially reverts it to what it was for my case.

Good luck.
(Bumping such an old thread mainly because I felt like the responses didn’t really explain exactly what you were asking. I hope my reply adds some value.)

13 Likes

Hi Pete

Thanks for your answer above .

I am trying to create an editor utility blueprint to change the collision preset on multiple static meshes at once.

I have made the below blueprint as a editor utility, but it doesn’t actually change the collision preset on the static mesh. Are you able to offer any advice? This would be much appreciated.

Ben

1 Like

On UE 5.2, I remember having some troubles with that function. Sometimes it works, sometimes not.

Example in a construction script: set the collision profile of a component that have BlockAll profile to NoCollision => this works. Later on, do the opposite: set back the component to BlockAll profile => nothing is changed (it remains in NoCollision profile)

Very strange. It is probably a bug, or something I misunderstood about that function.

1 Like

Hey Guys

If there is anyone who just needs to be able to change the collision preset on multiple objects at the same time, which was what I actually needed to do.

Just drop them into a blueprint, then select them all in there. You can then change the collision layer from the right hand side and will effect them all. Then drop the blueprint into the level.

1 Like

Hey Ben,

I was away but was going to head into engine to test it myself. I’m glad you figure it out!
That’s some useful tips, ty for sharing.

1 Like

Sometimes, the collision needs to move to update, some people move the transform of the actor by 0.01 and move it back to 0.00 and that will “update” the collisions.

2 Likes

Oh! I was not aware of this trick. Thanks for sharing!

2 Likes

Yes, moving to update is a method, or reload map.

2 Likes