Hey, I’m making a 2d sidescroller adventure game, and I’m trying to wrap my head around making a solid combat system. I’ve managed to make a character that hits an enemy and deals damage until it’s dead; I’ve added an AddImpulse to the EventAnyDamage because I want the character to be able to launch enemies in the air allowing for combos like in Super Smash Bros.
So my problem is this:
How do I launch in a direction based on where it was hit(if hit from below launch directly upwards, if hit on the diagonal launch that way etc.)
For now I’ve just set a simple Impulse straight along the Z axis, however when the enemy falls down again, IF at that point the character is standing underneath and the enemy lands on top of his head: First he will bounce and then proceed to go off axis falling behind the stage! This is weird because I’ve locked the movement along Y-axis but for some reason when the enemy is bouncing off the characters capsule it starts acting in 3 dimensions.
Are you using Paper2D physics or normal physics?
The fact that it moves even just a bit causes your enemy to fall from your level.Try making the floor collision a little bit thicker.
Paper2D physics? I tried both 3d and box2d physics, nothing really changed.
I made a new camera to get a better view of what was happening and it is not simply 0.1 change in y-axis, it’s actually bouncing so far back that it collides with the background sprite which is at -200 Y! sometimes it bounces forward as well. Maybe I haven’t set up the axis lock correctly, in which case I’d like some guidance on how to be sure of that! Thanks in advance!
As far as axis locking goes, if all else fails, just add an invisible blocking volume in front and behind your scene. It will create a narrow corridor for your 2d scene that nothing can fall off of. Cheap quick fix. It might not fix the actual problem but it would certainly prevent anything from going off your world for the time being.
The fact that your paper character flies off so far sounds like maybe a collision issue (things tend to fly off and 2 collisions occupy the same space) or the simulate physics is doing something wrong, maybe you could set the weight of your enemy to something heavier right after it hits the ground.
You could turn of the simulate physics and create your own bounce mechanics with some more impulses based on velocity and orientation.
Its really hard to say without being in your level, it’ll probably require some good debugging to figure out where the problem is.
He means Box2d.It is not fully implemented yet and it does not work.Hopefully one day they will give us full support.
Do both blueprints have a capsulecomponent?If yes go inside your components tab,clck on the capsulecomponent and set on the details panel under Base “ecb yes”.If this does ot fix it maybe your problem is this
Paper2d is super bugged at the moment unfortunately .
This fixes it for now, thank you! Need to find a way to be able to jump with a character standing on anothers head, but I’ll sort that out. Now to find a way to use navmesh in this flat world of mine…