I have a fully physics simulated character. Now I want to disable collision for certain bodies (while keeping the simulation for gravity and other forces). Basically I want to change this “Collision Response” but in game and on the fly:
My setup: ThirdPersonExample. Colllision preset of the mesh is changed to “Ragdoll”. At BeginPlay I make a ragdoll out of my character. DisableCollision is an ActorComponent that contains my code.
If I go into PhAT and disable collision for some bodies my ragdoll will fall (partially) through the floor. But now I want to operate directly on the USkeletalMeshComponent instance. As a test I want to disable the collision for all bodies so I try this:
for (FBodyInstance* Body : Mesh->Bodies)
This doesn’t work. On the other hand when I set my mesh to OverlapAll and put ECR_Block in that for-loop it doesn’t work either.
Am I missing some update function that I have to call after setting the collision or how would I go to implement something like this?