-2

I want to make a ball that bounces back from walls and hurdles but doesn't bounce in Y-axis. Is it possible I am currently applying force whenever the ball leaves the ground but it is not giving a realistic effect

1 Answers1

0

I thought there were checkboxes in the inspector to lock an axis... either way, you could cache the previous Y value in fixedUpdate() as "lockedY", and if the current Y axis value is higher, just reapply the cached one, I think.

  • I tried this too but this stops the ball from moving on an uneven surface as the Y-axis is locked. My environment is an uneven ground full of mud and obstacles – SAmi Shiekh Oct 02 '18 at 10:15