Change Collison Object Type of a RigidBody on a SkeletalMeshComponent

Hi all,

I set up a PhysicsAsset on a SkeletalMeshComponent on my character, but I would like to change the collision object types of certain rigid bodies on the fly instead of using the collision object type of the mesh component. Is it possible? How it could be done?

To my knowledge, collision channels and object types are limited to component scope. They cannot be applied further down the hierarchy to individual physics bodies. However, each body in the physics asset has an option to set a physics material (which can be different from the physics material applied to the whole mesh). From what I understood by going through https://docs.unrealengine.com/latest/INT/Engine/Physics/PhysicalMaterials/PhysMatUserGuide/ , these physics material overrides can be accessed through LineTrace (with the TraceComplex bool ON). There is a physics material output in the ‘Hit’ structure.

It can help you to distinguish between different physics bodies of your physics asset but I don’t know how expensive it might be or that if this is something you were looking for.
Cheers!

Thanks for your reply.

I knew PhysicsMaterials but I need to change Collision Object Types (collision channel) of some rigid bodies on a character ON THE FLY in AnimNotifies to simulate hit boxes in a fighting game but PMs cannot help me for that unless I can change PMs of rigid bodies on the fly as well.

In fact, there is a function called FBodyInstance::SetObjectType that is supposed to be able to change the collision object type of a rigid body, I tried but it didn’t work. Maybe I should post another question for that.