Code a Ball that never stops and bouncing back from walls

Hi there!!

I want to make a Breakout Clone and i experimented a lot with different mechanics for my Player Ball.

I used permanent force to Object (Ball) and the Bounce Plugin.

But this gives me not really a permanent movement. The ball has also a Gravity Force that brings him to the floor (bottom).I don’t want or need this :frowning: I want a permanent movement.


The Bouncing is also weird. I think i made a fundamental error somehow.

Is there someone wich can me guide to the right direction?!

Thank you !

First you can move your paddle only if the mouse position is >20 or <620 and not reposition it if it goes under or above these values.
Then you need 3 different collision conditions.
ball x paddle, ball x borders and ball x blocks and bounce the ball off for each one.
Lastly you you need to put the ball in your scene and trigger its movement by hitting a key, adding a permanent force(angle) using -45+RandomInRange(-5,5) for angle and the speed you wish.

Are you using the physics behavior? Normal force doesn’t have gravity.

Ohh yes i use the physics behaivior. i will try without! good point!! thank you !!

1 Like

Thank you for your feedback. i will see, what i can do in my next coding session on sunday. Have a nice weekend!

1 Like