# Make a game object move inside circle and bounce from walls without gravity

I have a circle with a RigidBody2D and CircleCollider2D components on it.

I'm trying to make it move constantly inside a bigger circle without gravity involved, make it bounce off the circle walls like it has constant velocity but without any delays, same speed all the time.

Here is an example of the same behaviour but inside a rectangle:

I would like to do the same but inside a circle and detect the collision with the circle walls

Thanks in advance :)

• I'm trying to change the transform position until I reach a destination point and then take another random point on the circle and get to it, But it's not a physics based solution, I want it to bounce out of the circle walls like a real physics collision, not to a random position Mar 9, 2018 at 10:56

• Thanks for the reply, this is not the answer, I already have my mass at 0 and gravity at 0, the thing with AddForce() is not clear to me, when to add force? how match? on Start? Every update? Mar 9, 2018 at 15:49
• It works, I've created a new Physics Material 2D named Bouncy with a friction of 0 and bounciness of 1 and added it to the ball, it now works great. Thanks Mar 9, 2018 at 16:25
• I'd recommend keeping some mass on the object, otherwise force calculations get a bit weird (acceleration = force / mass which approaches infinity as mass approaches zero). Mass itself won't slow the object down (quite the opposite - inertia due to mass resists slowing down) as long as you've turned off the drag. Mar 9, 2018 at 17:28