physics bounce off walls

Get help using Construct 2

Post » Sun Oct 06, 2013 9:52 pm

When using the built in physics behavior, I've noticed if objects are moving slowly, instead of bouncing off a wall as you'd expect, they become 'stuck' to the wall and move horizontal / vertically. It is hard to bounce into them to get them unstuck.
Is there a way around this with adding a random kick off the wall?
B
38
S
11
Posts: 198
Reputation: 3,963

Post » Sun Oct 06, 2013 10:05 pm

Have you checked your collision polygon? Did you try changing it in your physics behaviour settings?

You could always apply force or impulse at collision if needed.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 07, 2013 2:02 pm

Hi,
Just checked out what you suggested. The collision polygon is fine. It's on guess from shape and draws an octagon around the circle which looks ok. In the physics behavior it is set to circle. Elasticity is already at 0.7 and to be honest I'd like to keep this value or will bounce off other objects too much.
I have been trying to work out how to add a force on collision properly. My trouble is I have tried and the bounce then comes off at an incorrect angle. I need to try and keep the bounce on the proper expected angle.
Thanks
B
38
S
11
Posts: 198
Reputation: 3,963

Post » Mon Oct 07, 2013 2:10 pm

You might also check the walls, make sure in the physics behaviour they are set to bounding box.

The impulse at collision thing, might be a hassle to implement correctly.
Is physics absolutely nescessary for your game or could bullet behaviour with gravity work as well?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 07, 2013 2:37 pm

I guess I could change everything to bullet behavior. I am making it for android and found performance better using physics. Plus to me it was easier to set it up.
I had a look at the walls. They are all bounding box.
I've tried using Angle(0,0,Object[Physics].VelocityX,Object[Physics].VelocityY)
To get the movement angle and applying a force at this angle on collision, but sometimes it will just apply a force along the wall and the ball slides up the wall a bit faster =P
B
38
S
11
Posts: 198
Reputation: 3,963


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 6 guests