Collision of sprites with physics

Get help using Construct 2

Post » Wed Sep 18, 2013 2:54 pm

Hey guys,
I am stuck on a very simple subject. I have a project similar to this:

https://www.dropbox.com/s/28ebqmjx0sds9ck/collision.capx

I want the wall to be solid. When the car hits the wall it should stop. If I attach the "solid" behavior to the wall, the car starts to slide strangely and unnaturally against the wall. If I attach "physics" to the wall and set "Immovable" to "yes", the car just passes through the wall. Why does not the car stop?

In my project the car both has the "physics" behavior (to interact with other objects) and the "cars" behavior to move.

Any help is appreciated
B
8
S
1
G
2
Posts: 13
Reputation: 1,510

Post » Wed Sep 18, 2013 2:58 pm

You should never use the 'physics' behavior together with other movement behaviors - it just doesn't work like that. You will have to design your own system of applying torques and forces to make the car move and get rid of the car behavior, or alternatively get rid of the physics behavior and use C2's collision system.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Wed Sep 18, 2013 3:09 pm

Hey sqiddster,

Thanks a lot for the quick response :) If I delete the car behaviour (and make the car move by applying forces) then the "Immovable" set to "yes" on the wall will have effect?
B
8
S
1
G
2
Posts: 13
Reputation: 1,510

Post » Wed Sep 18, 2013 3:54 pm

Have you looked at the examples that come with C2?

There is a physics car one called 'Physics - vehicle.capx' which may help. Setting immoveable to 'Yes' should have the required affect of stopping the physics car.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,375
Reputation: 58,432

Post » Wed Sep 18, 2013 5:29 pm

Thanks zenox98. The examples helped me. I got it working now :)

A little offtopic but how could I make the steering a bit more direct? Now it seems like the car is floating/ flying.
B
8
S
1
G
2
Posts: 13
Reputation: 1,510


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, facecrime, mihirolover and 10 guests