print ("We left the screen for too long, respawning at ", spawn_position)
collision_shape.disabled = true
position = spawn_position
collision_shape.disabled = false
The above does not work. In the console:
Ball detected outside play area. Starting Respawn Timer
Ball is respawning!
We left the screen for too long, respawning at (512, 300)
It stays top left of the screen. The intended coordinates should be correct given where I originally placed the ball but it does not appear to be going there. Disabling the setmode back to rigid did not appear to succeed either, it just stopped collisions altogether (which makes sense since if I'm not mistaken static bodies act "idle" and won't trigger collisions themselves)
What is the best practice to respawn a rigid body 2d object by specifying specific locations?
An alternative route was to simply free and re-create the object at a set location, the results were the same, the object doesn't move from it's original scene position (0,0):
var new_ball = ball_res.instance()
var ball_pos = Vector2(512,300)
new_ball.position = ball_pos