Collision capsule sticking?

I’m not sure if this is a bug or if I’m missing something, but I’m noticing a weird type of behavior with character collisions that I want to eliminate.

The following video should hopefully demonstrate the issue; note that during this video I never stop holding the forward key.

When the player collides with the wall, his movement is partially obstructed, and he continues as best he can. Since he cannot move “fully forward”, he instead sort of slides along the wall in the closest possible approximation of the movement input.

When he collides with the enemy’s capsule, however, this doesn’t happen. If his capsule cannot move the way it’s supposed to, it simply stops entirely. This makes moving the player near enemies impossible since the player gets stuck on them unless he moves at exactly the right angle.

How do I change the way the player movement works so that the player always Attempts To Move even if he cannot?

Hey -

From your video it appears you are using a sphere component to detect collision for your player (and possibly the enemy as well?) If you remove the sphere component and instead use a capsule component you should get the behavior you’re expecting.

Cheers

Nope, both are capsules. The player has a fairly wide capsule (not wide enough to render it spherical) while the enemy has a very narrow one.

I actually managed to solve the problem, albeit by setting the enemy capsule to Can Step Up On (ECB Yes or whatever it’s called).

No idea why that should have fixed it, but it did.

Glad to hear you’re working again. Out of curiosity where is your capsule component in relation to the other components of your character? Is the capsule component the root or is something else?

Actually, while my player’s capsule is the root, my enemy has two capsules. the root capsule is used for driving the enemy around the level (i.e. it interacts with worldstatic and worlddynamic volumes), though the player can pass through it. The enemy then has a much smaller inner capsule for blocking the player.

This is done because the player’s capsule is rather large so that he can interact with level geometry properly without clipping through it constantly, and if he were to interact directly with the main capsule of the enemy he would be very far away from it. So instead he can pass through the enemy and then collides with a secondary collision shape at its center, letting him get closer without passing through the enemy. That may have been the cause of the conflict, but it still seems strange that there would be such a disconnect between the way certain collision primitives affect player movement.

Remember to disable it if you have more than one collision for enemy NPCs. I had an insect NPC which had a main Capsule and multiple collisions for its segments, its segments were causing the player to get stuck constantly because they came with “Can Character Step Up On” active.