Enabling/Disabling scenes/nodes or swapping them?

###Godot Version
Godot 4.2.1.stable

Having some trouble with code,

extends Node2D

func _ready():

func _process(delta):

func change_mode():
	if get_node("player_interact").is_processing():
		if Input.is_action_just_pressed("change_mode"):
	elif get_node("player_battle").is_processing():
		if Input.is_action_just_pressed("change_mode"):

Im trying to disable one node/scene while activating the other at the same time or with an extremely tiny delay at least but keep being met with errors of not being able to use the is_processing() function on the node since its null, im fairly new to gdscript and godot and this has been keeping me from getting any good progress at all. can someone please clarify the best way to do what im trying to achieve or just whats wrogn with what im doing? thanks

Instead of removing them, you could pause them and hide them. That way the nodes will still be there for the get_node() function.

would pausing and hiding remove all collision and stop processing?

If you’ve set the processing mode properly, yes. A non-processing node can’t affect anything, but can still be affected by other things that inspect it explicitly.

alright thanks man i’ll try this out and see if it works