The game is a head soccer game where the player has to try and score on the opponent. The enemy AI works by making the Vector position of the ball a global variable so that the enemy always has access to the ball's position in order to chase it. The problem I have ran into is that when creating a new ball instance, it creates an entirely new node which does not feed its position into the global variable that the enemy reads from, meaning the enemy will not follow the new ball.
The other option I have is to teleport the original ball back into the middle of the screen, but because it's a RigidBody2D, the teleporting functions don't work the same. I'm having trouble trying to figure out how to just put the ball in the center of the screen.
Essentially, when the ball enters the goal, I want the RigidBody2D Soccer Ball to teleport to the middle of the screen. If someone is capable of doing so, or knows anything that could help me towards my goal, that would be fantastic. I have been stuck on this problem in my coding class for a week now, and have no idea how to work around it.
Thanks!