Realistic physics between two moving objects

Get help using Construct 2

Post » Mon Mar 11, 2013 6:23 pm

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?

CollisionNotWorking.capx
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Mon Mar 11, 2013 7:01 pm

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.Excal2013-03-11 19:07:08
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Tue Mar 12, 2013 3:31 am

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.



CollisionNotWorking2.capx
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 19 guests