How can I set SkeletalMeshComponent to be the true dealer of character collisions?

Hi, I’m working on a blueprint character and want to get more accurate collisions between characters so events such as Overlap or Hit don’t fire when the characters’ CapsuleComponents collide but when the actual skeletal meshes collide (imagine a character punching another one, it’s not desired that the Hit event fires when the CapsuleComponents collide, but when the hand/fist part of the first mesh collides the other mesh).

So the problem I’ve encountered is that for Characters there’s apparenty some kind of hierarchy or prioriy order between diferent components for collisions, it seems that the root/base is the character’s CapsuleComponent and that the SkeletalMeshComponent isn’t actually used for collision; I say that because if I set the collision type of the capsule to be NoCollision, it doesn’t matter the type of collision for the mesh (BlockAll, Ragdoll or wathever), even the Mesh has a correct PhysicsAsset, the character falls of the world as it didn’t have collision. If the Capsule’s type is another, Pawn for example, the character doesn’t fall.

So how can I set the SkeletalMeshComponent to be the true holder or dealer of character collisions instead of the CapsuleComponent? The capsule is marked as “[ROOT]” in the character Blueprint Components and it’s not possible to take the seketal mesh component away from inside of the “[ROOT] CapsuleComponent” hierarchy, or create another mesh component outside of it.

You can use ComplexCollsion (ie test against actual geometry) in Collsion queries. But I don’t think this option is available to normal collision checks.

However try setting the ‘Trace Complex on Move’ property from the editor for this Actor. I have not tested it, but might work.
Form doc: “Trace Complex on Move If this is set to true, component sweeps with this component will trace against complex collision during movement. Complex Collision is, in short, per face collision, where as Simple Collision are your spheres, capsules, boxes, and generated convex shapes.”

Thanks for your comment. Trace Complex on Move set to true in the SkeletalMeshComponent apparently does nothing.

I’ve tried to find the “ComplexCollision” option or query you note, but haven’t been able to find it in the mesh properties nor in the character defaults. Could you point more specifically where it is, please?

Sorry to hear that it did not work.

Open properties of the static mesh (it might work for skeletal mesh as well - not sure)asset in content borwser. Set collision complexity to “use Complex as Simple”.

ComplexCollsion for collsion query may not be what you are looking for. It works only for collision trace queries (ie you use trace function to project a line and see which Actor it collides with).

Anyway this article has an explanation with screenshots:

Check the section SIMPLE AND COMPLEX COLLISION

Check these articles too. You might find something helpful:

G’day,

Try turning off “Generate Overlap Events” on the CapsuleComponent while enabling it on the SkeletalMeshComponent.

Another option to try is setting the CapsuleComponent collision to “Custom” and telling it to ignore Triggers.

Kris

Thanks for the suggestions, mindfane, but it seems that the options for collision you mention are only available for static mesh, and I’m using a character with a skeletal mesh, so can’t use them.

Hi, Kris, thanks for your suggestions. I have already tried that, and also for the Hit events, but the apparent hierarchy of the capsule over the mesh for collision stuff doesn’t change.

I’ve also tried several combinations of Custom collision, but “Trigger” is not one of the particular collision response type to chose wether to ignore, overlap or block.

Any other ideas? The key would be unveiling and reverting the apparent hierarchy of the CapsuleComponent over the mesh for collision detections.

Actually, from Print String I see that the element in the top of the collision hierarchy seems to be a hidden collision cylinder (like the one used for pawns in UDK), possibly part of the CapsuleComponent. This doesn’t change much, though, unless until I find out or someone can answer how to revert that hierarchy and put mesh collisions as the priority; another solution would be a a dynamic generation of collision-hulls option for skeletal meshes (like the ones for static meshes but generated over time, so they are animation consistent, this could be interesting, as it wouldn’t be as bad for performance as a per-poly collision model for skeletal meshes), but that is not available.

Is there any properties native for the Character actor and its subclasses to prevent the skeletal mesh from colliding? If so I would like to know how to disable it. Any information would be appreciated.

OK, so I’ve made so the Hit event, when fired, prints the components that collide from both blocked and bumping actors. The capsule is just a bit bigger than the character in iddle pose, but when in punching animation the mesh has a bigger extension in horizontal direction than the capsule.

What I’m going to explain happens the same way with different collision types (BlockAll, Pawn, CharacterMesh) for the SkeletalMeshComponent and the CapsuleComponent as long as both have ticked the Simulate Hit events option:

a) If the two characters are very close, so the capsules are touching each other, the Hit events print many messages at once: at the same time the meshes collide one with another, the capsules collide between them, and each capsule collides with each mesh. So this is a correct or expected behaviour.

b) If the two characters aren’t so close, so the capsules aren’t in contact, if one characters fires the event that plays the punch animation, the fist of the first character passes through the mesh and the capsule of the other character, but no Hit event seems to be fired, as no printing is done. This is not desired at all, I want to make it so collision always generates Hit events when blocking actors bump like in this exposed situation.

Do you know how to solve what explained in “b”? It seems like the collision Hit event of the mesh with the other mesh and capsule isn’t fired because character requires the first’s capsule to also be colliding at the same time (I say this because of what I’ve explained in “a”).Analizing the exposed situation it seems that the mesh component is discarded or ignored for Hit collisions if the capsule isn’t colliding as well. It might be because of another fact, though.

Any help or suggestions on the matter would be really welcome.

Any ideas?

Hello, Bob Chatman has told me when hat in another project he also needed to use mesh based collisions and that he solved it adding this line to the constructor of this character. It’s important to know in his case he was working with a StaticMeshComponent, not a SkeletalMeshComponent as I, and that was subclassing from Actor class, not Character as I do.

With this line he achieved that the Mesh was the root of the character (would be marked as “[ROOT]” in blueprints), and so, the true dealer of the collisions. I want to do this trying to make my SkeletalMeshComponent to be the root, and so, the collision of the character would be mesh-based.

//Mesh is the name of the mesh component in the character
RootComponent = Mesh

Although my character is purely BP based, it extends from a nearly empty class that subclasses from Character.cpp (as it was generated in the 3rd person C++ template).

I’ve added that line to the constructor and it compiles fine, but in the editor the character shows no changes. It might be some overriding going on, but I can say I haven’t modified anything related to RootComponent in my blueprints or code, so must be something from the default engine stuff.

Do you have any ideas on how to make this work or can point any clues on the general question of the thread? Any suggestions would be very welcome.

Has anyone figured this out dealing with the same issue.

Not me, in my case I’m using temporary something different (and by now worse), let’s see if someone else can answer this.

I was thinking of just starting from the pawn class and adding my own control code for the character to move around.

If you do that you can certainly set a skeletal mesh or a static mesh to be the root, but in my case I’m using a high amount of Character derived variables and functions (and from its components), so another solution is possibly easier to implement for me.

I noticed this aswell if the two characters are not colliding with the capsules the fist hit events do not register. As this is in blueprint it would be nice to know the trick to fix this but honestly I would take a code version as well.

I’ve made a pair of requests as workarounds for this, but they haven’t been answered yet:

Looking into the Character.cpp file the collision cylinder is just the name assigned to the capsule. Here is the name being defined:

FName ACharacter::CapsuleComponentName(TEXT(“CollisionCylinder”));

And here is the name being used to construct the capsule:

CapsuleComponent = PCIP.CreateDefaultSubobject(this, ACharacter::CapsuleComponentName);

Hi, I tried some time ago in C++ to make the skeletal mesh the RootComponent, but because of possibly some hidden overriding it had no effect. Here you have the link, maybe you figure out something from there: