Right now, when the player collides with the enemy, the enemy doesn't move, nor does the player "bounce" off of them.
I want to simulate realistic physics where if the player hits an enemy, the two 'bounce' off each other.
Does anyone know how to do this?
Develop games in your browser. Powerful, performant & highly capable.
I removed the player setting to stop custom movement so now the player seems to collide and react well.
The enemy still does not react to the collision, instead staying there like a brick during the collision.
UPDATE: I think I solved the issue. The AI pathfinding was causing it to continue moving along the found path during the collision, which overrides the physics behavior that would cause it to bounce. Stopping the enemy's movement along the AI path during collision seems to allow the physics behavior simulate a collision.
Here's an updated version of the project.
The player is now correctly 'bouncing' off of the enemy upon collision, but the enemy remains in place. I'm not sure how to make the enemy 'bounce' (completing Newton's Law). Any help in this area would be appreciated.
Here's a screenshot of the events where the collision is handled.
<img src="http://i.imgur.com/AxpmsLU.png" border="0">