Download

Removing Physics Constraint in Blueprint

Hi there - I have a blueprint i’m struggling with where i want to be able to move an object with physics, but not influence others of the same class as it’s being moved. ie. The other physics actors need to be locked/constrained.

I have the constraint working fine - when the actor moving is picked up, the others create a physics constraint component on the static mesh and stay in place.

However I cannot find a way to remove the constraint - destroying the component doesn’t work, trying to reset the component its restraining doesn’t work either. Changing the linear limits to None doesn’t work either.

Any one had similar issue or know of another way to solve? How can you remove a Physics Constraint in place in a Blueprint?

I also have it partially solved by adjusting the lock position & rotation constraints on the mesh itself (ie. no physics constrain component) - but need a few alternative settings for another element I’ve added. is there a way to add custom lock settings without c++?

Thanks!

What you are asking is a little unclear.

Do you have a system in place that is locking the constraints in place already, or are those constraints set in the engine beforehand and that’s it?

What I’m getting at is, if you are already performing alterations via code or blueprint during an event, maybe the object you are having trouble changing constraints on is part of that sequence of events, and it is overriding whatever else you are doing (depends on how you call the function that locks things in place).

Generally speaking, in terms of enabling disabling, I use the enable physics as a whole.
set simulate physics is the node you want. Usually dragged off from a static/skeltal mesh.

Example: pick up object, freeze other surrounding objects in player area by disabling physics until picked object is released, at which point (or if the area shifts) the physics get re-enabled.

Thanks so much for your reply - there doesn’t appear anything conflicting. I had tried enabling/disabling physics but it didn’t work, though having tested it now, it appears to be working fine! So yes the logic you suggested is how I’ve built it.