Unity 2D The Bounce of The Ball After Hitting The Wall

30 views Asked by At

I want to make the ball be bounced after hitting the wall.What i have to write to the script?The image of the thing i want to do

I searched about this on the internet but i couldnt find what i want.I asked to ChatGPT it didnt work.

1

There are 1 answers

1
AudioBubble On

This is a vague answer, probably not something you should ask here, and its very simple so I don't know how you cant find it online. But I'll provide an answer anyway:

To make objects bounce, you need to use Physics Materials. To create one, right click on the project window, click create > 2D > Physics material 2D

enter image description here

Adjust the values to your liking

enter image description here

Then drag it onto your ball.