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?
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.
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.
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.
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.
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.