Changing an actor from static-> movable onclick?

Hey there, I have scoured many pages and found no documentation on changing an actor from static to movable on the fly and then back again. For example, I want to have all of the actors static (to avoid physics collisions), but when I click on it to drag it around I want it to be changed to movable. Is there a simpler way of doing this which is staring me in the face or is this an acceptable method to perform what I need? For reference this is for a card game and the actors are cards.

So ideally I would just change the target of my click+drag function from static to movable onclick and then change it back to static on unclick. Any help would be appreciated, cheers!

Did you tried changing mobility (EComponentMobility) on one of your components using SetMobility() function?

I am a shocker with programming, is it possible to do it through blueprints?

I don’t believe this to be possible. You can just turn off collision actor until you need it.

So I leave all of the actors on ignore collisions up until I click on them. Can you change their “oncollision” value through blueprints? Thanks for your answer Distul!

Yes, you can drag a pin from the actor and enable or disable physics. I don’t remember the node name but it says something about enable physics.

Unfortunately I couldn’t find a node to set an actor’s mobility, but I did find a couple work-arounds.

Option A) Create a custom blueprint using Static Mesh Actor as the base class, then in that blueprint set its mobility to movable. Any actors you then spawn from that class will be movable, you’ll just need to swap the static mesh out if you want to change its visual appearance.

In the case of your game, this would mean that OnClick you replace the actor with a duplicate made using this class, and then on release reverse that.

Option B) You’d need to use a boolean to track whether the Static Object is clicked or not, and in the OnTick function, if the object is clicked, use a Set Location node to change the object’s position each frame, likely based on where your mouse is.