Physics 2.0 Ball Hugging the wall after bounce

How do I…

Make a bounce work consistently with income Angle equals outcome angle, i.e, a ball bounces and does not start hugging the wall

What is the expected result

I want bouncing bullets, they should bounce of walls using the Phsics Engine 2.0
restitute is 1

What is the actual result

The Bullet comes in and just starts hugging the wall

Related screenshots

All bullets come from the same angle but instead of bouncing they just stay next to the wall
I am not allowed to add the picture so only a description :woozy_face:

How are you applying the force to the bullet? Can you provide a screen snip of the events around it?

Hey thank you for your time ^^

What is the restitution of the wall object?
Do you have any collision events for wall & cannonball?
Does the cannonball make reducing bouncing movements, or does it become dead still once it’s hit the wall?
Have you tried unchecking Can Sleep in the physics settings? It shouldn’t make any difference, but it’d be good to cross that possibility off.

The wall object has a restitution of 1
I unchecked sleep
it does not become dead still it just starts going along the wall
So instead of bouncing away it starts moving parallel to the wall
I changed shapes to squares and it work a bit better

It sounds like there is a force or gravity being applied to it, but I can’t see the latter being the issue if you have set gravity scale to 0. Check your events to see if there are any other events where a force is applied.

Don’t use square collision for a ball - it’ll behave weirdly when it bounces off other physics objects.

I just searched for impulse and phsics 2.0 and I only use it to create a cannonball and then add an impulse right away. Is impulse the wrong way? As it applies only only once? Or is there a system wide gravity scale to consider?

edit: Adding a circle collider made the bullets slower…

edit2: I addded the bullet check

Do you do anything else with the cannonball in other events?

I test for collision and delete it after a certain amount of collisions with the wall. I also check for enemies.

I do both with the event … started colliding with … from the phsics 2.0 engine

One thing that might be wierd is that the static object has layer 1 and the cannon ball has the mask 1

Can you set the cannonballs mask and layer to 1, and the same for the static wall object? Is there a reason why you changed the cannonball layer to 2? The mask and layer are used to determine collisions.

And I guess one other question - do you have any other behaviours attached to the wall or cannonball objects?

I did not want cannon balls to collide with each other

No other behaviours are applied

I made a small test scene

I dont know how to share the project itself

I’m ruinning out of ideas on what is causing it. Do you mind sharing your .json file, and I’ll have a look into it? Even if you PM a link to it. I’ll have a quick look at it and see if I can spot what’s going on.

Sorry for being an absolute noob, but how do I upload or DM a json on this forum?

The best way is to put it onto a shared server (like DropBox, GoogleDrive, OneDrive etc) and post the link. You can only post or DM images in this forum.

I hope this works ^^

That worked. I’ve had a quick look, I’m at work at the moment, so I’ll have a closer look when I get home. Nothing obvious stands out.

I notice the cannonball does bounce off the wall along the top if the cannonball is fired to the left, but not if it’s fired to the right.

I think it’s a bug in the physics engine. I’ve recreated it in a simple project of just a ball and wall. I’ve started another thread to report it.

1 Like

Thank you! How long does it take for such a thing to usually be addressed?

That depends on when it gets picked up, the developer availability and complexity of the problem.

One thing I hadn’t looked at was if the velocity was an issue, and if faster moving objects means it will work. You could try this yourself - make all the sprites 2-4 times later, zoom the camera out proportionally and increase the forces applied to the cannonballs.