Hi,
I'm using Godot 3.1.1 and I need to switch between two cameras when a button is pressed. I was trying to use set_current to switch between them but it doesn't seem to work. I have the following code:
extends Spatial
func _ready():
pass
func _input(event):
if event.is_action_pressed("switch"):
$Camera1.set_current(not $Camera1.current)
$Camera2.set_current(not $Camera2.current)
When I print the state before and after the set_current() function, it doesn't change so the cameras are not switching. If I instead do it like the code below, it works.
func _input(event):
if event.is_action_pressed("switch"):
if $Camera1.is_current():
$Camera1.clear_current(true)
else:
$Camera2.clear_current(true)
Did I miss something about how set_current works()? Is it not supposed to be used like this?