Is it possible to have a skeletal mesh as part of a pawn while it is set to ragdoll physics? I have a setup with a pawn which dictates the movement of the player. As a visible part I would like to “drag along” a skeletal mesh without any animations. However, when I set the physics of this skeletal mesh to “ragdoll”, it instantly disconnects.
The only solution I found so far was, to set the location of this skeletal mesh anew each tick, but that does not seem like the correct option to do so.
Any ideas or links to possible solutions are very welcome!
The Character actor has a Capsule as its root component. All other components base their positions on that root.
When you set a component to Similate Physics or “ragdoll”, then the physics engine will take over determining that component’s location and rotation in the world. This means that it is no longer based on the parent component.
If you want to attach a component to another in physics simulation, you must use physics constraints.
I think your idea of updating the Actor transform every tick should be fine if it’s not causing any other problems (make sure collisions are turned off for all other components that are not simulating though!).
If you want to restore normal movement and control and stop simulating physics and have it resume as normal, then it gets a bit tricky. You have to teleport the Actor or root component to the ragdoll’s current location, then adjust it so it’s not going to be penetrating any of the environment, then I think you might have to destroy the simulated component, spawn a new one, and attach it to the Actor in the same way as it was before.
There might be a better way but that’s what I ended up doing by trial and error.