Im in the middle of making a breakout game, and i want to make it so that when you start the level, and when you lose a life and want to start of the ball agian you “shoot” it from the paddle like in this video: DX-Ball 1.07 Board 01-05 - YouTube, atm i have it so it just spawn above the blocks, and before that it was random on a specific x position line(this does not matter just saying, it don’t really work in this kind of game :p)
The quick and dirty of it. Make the ball a child of the parent(paddle). When the user clicks the mouse button or hits the launch key on the keyboard(or whatever), the ball’s parent is null and you give it some force or however you are doing.
When the ball is a child of the paddle, it will move where the paddle moves up and until you launch and null the ball’s parent.
when you lose your ball, if it’s a prefab, you can instantiate it just above the paddle
After that, in FixedUpdate(), you have to maintain the ball in the initial position until you press [your release command] and than add a force to it