Friction without interaction

I would like to create a game with balls rolling along the ground, viewed from the top.

This means that I’d like the ground to cover the screen.

But I’d like friction between the objects and the ground, or to “simulate” the friction by having all the balls/circles just have friction when moving around the screen.

Currently, if I put the ground underneath the circles, the circles just fly off, and if I make the ground not be a physics object, I can’t get friction to work (the circles don’t slow down).

Is there any way to either have the circles stay on the ground, or to create friction without objects touching anything?

(If not, I’ll try to create a function that will change the individual gravity of the objects to make this effect)

Hi @happylondon4,

Fortunately, this is a lot easier than tinkering with individual gravity. To simulate top-down 2D friction, just set the “linear damping” of the balls to higher than 0. This makes them behave as if drag (air) or friction is being applied, and they’ll gradually slow down after some amount of force/impulse is applied.

https://docs.coronalabs.com/api/type/Body/linearDamping.html

Best regards,

Brent

Hi @happylondon4,

Fortunately, this is a lot easier than tinkering with individual gravity. To simulate top-down 2D friction, just set the “linear damping” of the balls to higher than 0. This makes them behave as if drag (air) or friction is being applied, and they’ll gradually slow down after some amount of force/impulse is applied.

https://docs.coronalabs.com/api/type/Body/linearDamping.html

Best regards,

Brent