Download

Attach Second Collision to Player

Hey all
I have my character set up running, jumping, crouching and everything using the Player Controller, but a problem I face is that the crouch/crawl posing, and the attack animations, go forward a bit and out of the capsule collider which means the character’s head will clip into a wall if you face it and crouch or attack. I’d rather not increase the size of the capsule as it works for everything else.

After some research I know that (currently) Player classes don’t allow for multiple colliders which is a pain. But my idea would be to create a pawn BP or something which contains a small capsule collider, and I’d attach this somehow to the front of my player when the iscrouching or isattacking bools are triggered. However simply adding this class as a child to the player just results in that capsule going through all the scenery and ignores any sort of collision.

Does anyone have any suggestions to how I could attach this for it to work (if that’s even a viable way of getting round this problem) or even better, an alternative solution that doesn’t involve C++ or changing the player class to a pawn. I’m an animator primarily so C++ is kind of out of my scope; I mainly just want to stop a player from shoving their face into all the walls.

Cheers!

Hi ,

Maybe it’s a completely stupid idea but what about moving the relative position of your character a few units back when crouching ?

Cheers for the suggestion. I was actually thinking of doing that for the crouch, would solve a lot of the issue, and roping in a bit of root motion work for the attack. It seems that when you attach a new pawn with a collider to the player pawn, that pawn’s collision loses its effect against other static objects, which is a bit of a pain.

I think it’s down to the limitation to player classes, which I really hope gets addressed in a future version as it’s really limiting to have a single caspule collider for a player, especially if it’s something long like a quadruped character.