Hey guys, so, my project is room based, each room has colisors (red).
The enemies are moving using physics, the only way that I found that moves the enemies like vampire survivors, without overlapping them.
When the player attacks, if he attacks an enemy, the enemy got a knockback effect, where now he move at angle to a specific force*dt like the image.
The problem is that I could not find a way to prevent enemies from overlapping the room colisors, even changing the move to angle for apply impulse.. Sometimes it works, sometimes the enemy just overlaps and get stuck there..
Can anyone help me?
How the Orc knockback works right now:
Is overlapping attack_colisor -> trigger once -> Orc.Timer.Knockback Start
Is Orc.Timer.Knockback running -> Set Orc.Physics.velocity = 0, Move Orc at Angle: angle(player.X,player.Y,Self.X,Self.Y) distance: playerKnockbackStrength*dt