Download

Mesh Change in runtime breaks(?) PhysicsContstraint

Hello, having an issue with changing/setting a mesh at runtime and the physics constraint stops working.

So I have a player with a couple of static mesh components that use a Physics Constraint for a “bouncing” effect while moving. They move as expect right now when the player is moving(cubes to for testing). The player picks up an item and then swap the mesh, the cube is replaced with another mesh. When that happens the new mesh is set to the same position, but then falls in place. No matter how much the player moves around it stays in the same place on the map regardless of how the player moves away from it.

I feel that the cause is that the constraint is broken, but I’ve been unable to find a way to un-break it. I also could be barking up the wrong tree.

Probably due to the way you attach or swap.

So the way I swapped it was with SetStaticMesh. So your right, something I don’t know about how that works breaks it. I never managed to get a good fix for it. But I just managed a work around just a short while ago. I used an invisible object for the constraint point, then attached the changing mesh to that. That worked around the problem. Though it leaves kinda of a wasted node.