When the player dodges and hits the enemy AI it jumps, and I do not want that to happen.
I already setup a system when the player is close to pawns and dodges, root motion will be ignored and he wont bump into the AI but this creates another problem where the player won’t dodge away from the AI even if he isn’t dodging into him because root motion is ignored.
Things I tried and didn’t work:
Lower depenetration value
Remove ability to jump
Remove jump animation
Set Z velocity to 0
All attachments have no collisions with pawns
Hi @Codephase-Games ,
I don’t know much about AI, but at first glance this seems to be related to a capsule collision issue, however, as you mentioned, none of the attachments have collision enabled against Pawns, so that might rule out attachment collisions as the cause
I did a bit of research and found some posts describing similar behavior, where characters get lifted or pushed when colliding.
I think they could serve as a guide to help identify a possible solution.
So AI character is jumping because the root motion montage played by the player causes vertical motion that the AI’s CharacterMovementComponent interprets as a jump. This is also true when player attacks the AI as well, mentioned in other forums.
To stop this just, in AI blueprint, set the CharacterMovementMode = None.
But this creates a lot of other issues such as the AI cannot move anymore. Solve this issue by setting a timer by event, Time=0.01, Looping and Max once per frame, with the following inside it (you probably want to check for better ways of optimizing it).
So you only set movement mode to none and no root motion when both AI and Player blueprints and when they are attacking and within the attack radius there is an enemy. Allow Physics During Anim Root Motion is for the AI to rotate towards the player when it attacks and only does whenever you want it (in my case AttackRotation is set in the animation)