Constant bounce between two objects

Hi.
I’ve looked in the forum and I tried many things but I cant make a ball bounce with constant velocity between two walls. Probably the physics thing is not the best way to do it. But I tried with physics and force and with no luck. The ball is always getting momentum and starts bouncing faster and faster.
Can someone help please?.

Thanks

Hello @PNVG ,
I try to help you with two suggestions:
1- check the GD example using the filter word “bounce”


2- use the bounce extension:
image

Thanks,
J

HI.

I manage to put the ball doing exactly what the bounce game does but that’s not what I need.
I need the ball to go from one wall and go up and hit another wall and come back and so on, in same velocity. Like a loop. I used the bounce thing that I installed and choosed bounce of another object but nothing.

Thanks.





1 Like

You may take a look at this: (8) Physics Engine 2.0 - In Depth Tutorial - GDevelop - YouTube

1 Like

The bounce isn’t compatible with Physics.
If it’s purely visual, use tweens.
If you need standard interaction, use the bounce.
If you need Physics, you could try tweaking the values. My guess is restitution at 1 and all the others at 0, except density if you need some.

3 Likes

I’ve seen it. I think I should watch the arkanoid thing. What the ball is doing in that game is similar to what I need.
Thanks.

1 Like

The idea is to interact. Im going to check the arkanoid example and see how the ball works.
Its bouncing on the walls and the speed is almost the same at all time.
Thanks.

Without knowing crap about gdev, I think a way to do this is to give an impulse to the ball and tell it if it collides with wall give impulse on the other way and so on, and controlling the speed.
How to make this in gdev, I dont know but I will try what you said.
Thanks.

Hi. I just found a way to do it but in Unity. How do I close this thread?
I appreciate the help.
Thanks.

1 Like