Toggle collision on static mesh in blueprint [UE4-4.26]

hi all.

im trying to create a blueprint that allows me to toggle the visibility and collision on a static mesh in editor via a boolean. ive tried set collision enabled and it turns the collision of but it seems to lock to that setting and wont switch back. in the detail panel the for the blueprint when i select the mesh ive tried to hide it seems to be locked and wont change. might it be something to do with this?

this is what ive tried and it turns the visibility and collision of first time but then wont turn back on

thanks for any help

You’re not setting the bool, so you get stuck in one state.

hi

thanks for the reply. sorry blueprints arnt my speciality but how would you control this using the flip flop and and a variable so i can switch it ion and of in the details for the blueprint?
blueprint2

thanks again

In the main code

and in the construction script

image

coll

And if you want to invert it at runtime:

hi again. did that also turn the collision on and of with the visibility as it doesnt seem to with mine. sorry i want to check im not missing something

Yes, it will also swap the collision.