Why do actors bounce/launch eachother?

I am having an issues where the AI i have created. Every now and then when they walk near each other and get ‘kicked’ or bounce away from another NPC, sometimes being launched halfway across the level or really high in the air. This also happens to my player character. I have tried playing around with the Agent Physics but i have had no luck.

Does anyone have any ideas on how to turn this off?

1 Like

Bump - would really be nice to find out what causes this.

Bump - We can disable the contact, but i really wanna know how to control it.

I was having a similar issue and after some debugging with watching the velocity I determined in my case it is happening due to the function UCharacterMovementComponent::JumpOff which is called when the base (ground) changes to an actor the pawn can’t SetBase on (which is the case for pawns basing other pawns.)

I decided to override APawn::CanBeBaseForCharacter and allow certain pawns to always be able to SetBase on each other but there is also CanCharacterStepUpOn which can be used to control this.

With this solved a new issue comes up though which appears to be the true root of the problem is that occasionally pawns colliding with other pawns end up on top of one another. I’ve not yet determined what causes this but it appears to happen somewhere in the movement component code. I may just override and restore their last known good position when this happens which while a hacky solution should solve this hopefully.

EDIT: After overriding my characters movement component and reworking the PhysWalking function to revert the move if a SetBase was called on a pawn with another pawn everything appears to be working great. It’s not the ideal solution but until I have more time to look into it - it seems to be working fine.

Well, I’m having the same problem for awhile now.

Dear Epic, Is there a better fix for this?

1 Like

Can you please post screenshots?

In my case root motion of the skeletal mesh inside the capsule caused that issue. The feets of my character stick out of the capsule component while running (see attatched image). My guess is that root motion adds force while moving which causes the bumping. Thats what I did:

Go to edit->project settings->collision and add a new object channel (name it so you can identify the object type, in my case I named it ‘Zombie’). After that you go to your mesh settings inside the blueprint of the AI. Click on the mesh component. Now go to details (right side of the screen on default) and look for ‘Collision’. Make sure you set ‘Collision Preset’ to Custom. Change the object type to your newly created object type (in my case ‘Zombie’). Below the object you should find the new collision response (‘Zombie’). Click on the checkbox for ignore on that item ('Zombies). This makes sure that the skeletal mesh of the same type won’t collide and the bumping should go away.

Cheers,
J.

setting UCharacterMovementComponent’s “jump off zfactor” in blueprint to ‘0’ has solved my case

1 Like

In my case I the collision of the skeletal mesh component is incorrectly set to pawn. The collision should be only a the capsule.

I set this on both my player character and the NPC and it didn’t solve the issue.

Also didn’t change anything. I can still bump my NPC within a matter of seconds

so down-vote my answer, to demotivate me from helping anybody anymore on answerhub.
like if you were the only one here that needs a solution

1 Like

It’s not personal. It’s just not the solution which is why I down voted.

do you realize that same symptoms/bugs may be caused by different problems, therefore having different solutions?

Up-voting. This reduced the rocket launches my NPCs were making. I identified that my issue is more to do with where I am spawning my NPCs - they’re basically inside one another.

Bro i don’t know how can i thanks. This is really helped me.

I’m glad I could help. Thank’s for your comment.

My solution was to turn off mesh collisions on both character and enemy actor. Also later on I’ve switched to custom collision so I can achieve some ragdolling.

For me, removing the physics asset associated with the mesh fixed it. I realise this might not be posible for everyone though

In my case, I changed the following settings for my character mesh and it solved the problem. Walkable Slope Override=true, Walkable Slope Behavior=Unwalkable. I don’t know if this causes any other problems. How I imagine this works is it prevents the character mesh from being a walkable slope.