For a game i’m making, i have my character running and encountering enemies.
Whenever he touches an enemy, i need to detect a collision in order apply damage to the character, without the bodies colliding and moving away. The player should run through the enemy while receiving damage. I can resolve this without physics, just by comparing x coordinates.
Now, the problem comes when i want my character to be able to jump ON the enemies, and bouncing over their head. I need to detect the exact moment when the “feet” of the player hit the “head” of the enemy, and then apply an impulse or force to get the bouncing effect.
I can only think of achieving this with collision detection. After detecting a collision between the character and the enemy, if the character’s y coordinates are lower (in value, upper in stage) then he’s on top of the enemy, so he is jumping on it.
Is there a way to get a dynamic body to behave as a sensor while being able to completely collide with other thins?
I need my enemy to collide with the floor and detect collisions with the main character (but not applying any “crash” force after that).
I also don’t believe this can be achieved with collision filters.
I would appreciate a lot any kind of help! [import]uid: 105206 topic_id: 26103 reply_id: 326103[/import]