I’m making a generic Pong game (pretty much replicating it with my own understanding of it) from scratch, and my idea of how the ball is destroyed and instantiated is as follows:
when the ball hits the Player2 goal collider (Player 1 gets the point), The ball’s script calls it’s function to destroy itself, and the GoalCollider script calls " game.spawnBallP1(); ", where game is the “game” is a reference to the GamePong script, which is pretty much the whole game managing script.
The GamePong’s SpawnBallP1() function, only has “Instantiate(spawnBall, player1Launcher.transform.position, Quaternion. identity);”
I was wondering if there was a way to Invoke the instantiation of the ball, without having to make the “timer” by code.