Psuedo-3D bouncing ball - Unity

Опубликовано: 16 Июль 2026
на канале: badfitz66
66
0

Made a psuedo-3d bouncing ball thing in Unity based off something GucioDev about 2 years ago (   • Balls and top-down 2D 3D jumping/fake heig...  )

How it works:
I have an empty with 4 objects as children: The ball sprite, the ball's shadow, a 'fake floor' (we'll talk about that more), and the camera.

The ball's sprite is the only thing that has physics on it. I have a circle collider and a 2D rigidbody attached to it (with a bouncy physics material). When the player clicks, I add a force upwards to the ball and also move the empty in the opposite direction to where my mouse is which in turn moves everything else. The fake floor basically acts to further the illusion by allowing the ball to bounce on something. It's just a spriterenderer with no sprite with a 2d box collider.

There's also a bunch of other stuff like sound effects based on how hard the ball hits the floor, the shadow getting smaller the higher the ball goes, the force of the ball being hit being based on how high the ball is when I click (less force the higher the ball is from the fake floor).

I doubt this is how guciodev did his, but it's the only way I could think of easily getting this effect. I also didn't add a bunch of effects gucio had in his video such as the ball squishing and expanding as it hj