I’m making a pong-style replica. I have all my necessary objects, ball, paddles, gameboard, etc. I also have a Game Controller object, which I have my ball speed, player speed, movement, etc. controlled from. But, I’m having to put a script onto the ball itself to detect which direction to apply forces when it collides with the paddles and so forth. I want to be able to handle that detection from the game controller as well…
I understand the basics of OnCollisionEnter(), OnCollisionExit(), OnCollisionStay() functions. But from what I know, you’re required to use that function within a script component attached to one of the colliding objects, in my case the ball. I would like to keep my scripts all on"Game Controller" object, separate from the objects actually used and manipulated in game, so all my main variables, functions, etc. can be together in a single location. Is there a way to do this?