Limit bouncing to x and y axis only, not z axis.
I want to bounce the ball back after touching a capsule. The ball bounces but it goes to the z axis and off the track. How can I limit bouncing only to x and y axis?
Comment
I turned 'Is Trigger' ON and ball moves through the capsule but capsule doesn't disappear though I have set SetActive(false) in collision detection method. Ball basically is not detecting collision with the capsule.
Your answer
![](https://koobas.hobune.stream/wayback/20220612082231im_/https://answers.unity.com/themes/thub/images/avi.jpg)