I have this weird problem with skeletal meshes. When one skeletal mesh tries to push another skeletal mesh, that pushed one is launched away. Look at the video:
Sometimes it is not happening, but when it does, for example with melee attack, it can ruin whole gameplay.
Could you please provide some details on what exactly your enemy is doing when you see the character getting pushed away? How are you setting up that melee attack? Could you provide some screenshots of your blueprints, please?
I don’t think so it’s specific for melee attack - you can see at 0:03 that player was launched and AI didn’t perform melee attack, just turned around.
For melee attack I don’t do anything crazy - just sphere trace around bones using timer, only during melee attack animation. When trace hit actor is players character class, subtracting health from player. Nothing is related with physics.
In physics assets I disabled collison response for leg bones to prevent that “launching”. It didn’t help that much. Probably when I would disable collision response for all bones in physical asset, that would not happen. But I can’t do that. I need to have collision response from most bones.
I attached physics assets from player and AI, and set up from mesh and collsion as well.
Thank you for providing the information. I have attempted to reproduce this issue, but I haven’t been able to do so as of yet. Would you be able to zip up your project and send me a link to Dropbox where I can download it? I’d like to take a look at your setup and see if there is something that I’m missing as far as why I cannot see the same behavior on our end. You can PM me the link on the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint
Are any of the animations that you have in the project altering the location of the capsule? It seems like there is an overlap issue, which is causing the collision to force away from the other collision, and thus explains why you are seeing your character launch into the air. Is this possible?
Yes, there is couple animations with root motion (slide kick and vault), and I think I added animation layer for side kick animation, which keeps character more in capsule - in source animation character was moving out from capsule, which I don’t want for this animation.
Sean asked me to take a look at this issue and first suspicion was the mesh collision presets for the AI character. So I switched the Pawn collision response to “Overlap” instead of “Block” for the Mesh component of SideScrollerAI. The bug stopped occurring, but I saw you tried disabling the collision on the legs. I checked on the physics asset and it looks like ou forgot the body over the toes. Collision is still enabled. Disabling and setting Pawn collision response back to “Block” got rid of the bug (which was reproducing quite regularly at first).
If you ever need the legs to overlap with the enemy pawn for whatever reason, you can re-enable collision on these Physics Bodies, but instead go into your SideScrollerAI Blueprint and change the Collision Response for Pawn to “Overlap” so that you can receive overlap events. This will keep it from moving the enemy pawn under the “Block” response.
I didn’t work that way but you gaved me some clue. I had to change collision response for AI mesh to “Overlap” for “WorldDynamic”, not “Pawn”. Because player’s capsule is “WorldDynamic” type, and this worked fine for me.