extends RigidBody2D var start_position var do_reset = false # Called when the node enters the scene tree for the first time. func _ready(): start_position = position do_reset = true # Override the default physics when we want to manually reset the position and rotation. func _integrate_forces(state): if do_reset: state.transform.origin = start_position state.linear_velocity = Vector2() apply_central_impulse(Vector2(500, -800)) apply_torque_impulse(10000.0) do_reset = false func _input(event): if event.is_action_pressed("shoot"): do_reset = true