Physics - Pushing a rock.

Get help using Construct 2

Post » Tue Mar 26, 2013 5:25 pm

I'm new to the physics engine, so just playing around with it.

Let's say the player pushes into a rock. The problem with the standard behaviour is that if he runs fast enough, he runs straight through the rock which flies over his head. Also if he pushes it into a solid wall, he runs underneath and it raises over his head again.

So, how can I make him push the rock, but never actually overlap it?
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Tue Mar 26, 2013 6:11 pm

test the X and Y coordinates of the rock compared to the player? Disable the physics or movement when the scenario matches certain corrdinates? You can do similar things with platform and solids by moving the "rock" (solid object) based on the speed of the player object. You can't overlap solids.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Wed Mar 27, 2013 2:50 pm

Are you using the platform behaviour on the player? The physics behaviour isn't really meant to be used with other behaviours, but you could make your player a physics object and simulate controls like this:

PhysicsRock.capx (r123.2)Nimtrix2013-03-27 14:51:17
B
27
S
8
G
8
Posts: 903
Reputation: 8,452


Return to How do I....?

Who is online

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