Topic was automatically imported from the old Question2Answer platform.
Asked By
theMX89
hi, im triying to make an gameoverscrene.
in the gameoverscreen, you can press R to respawn.
if i press R while the screen isnt visible i respawn also.
func _process(delta):
if Input.is_action_pressed(“r_respawn”):
get_tree().change_scene(“res://planets/Spatial”)
where and how do i have to write “and gameoverscreen.visible=true:” ?
cos it doesn’t work if i set it after the (“r_respawn”)
Is it a 3d game?
If yes then have you added any camera node? For 3d games its very important to have an camera3d node. So just try adding an camera 3d node to your scene
it’s almost a complete 3d game. it’s a first person game, and my problem is that i want the gameoverscrene in the same scene as the game itself. the gameoverscrene is in 2d and you see it, if you die.
I have programmed that when you press r, you respawn, and when you press q, you come to the main menu. but if you press r or q, even if you are not dead yet, you respawn or you will be brought to the main menu anyway. that’s why I wanted to use “and” in the if statement, but I don’t know how to do it. so i came here.
Got it!
You mean 2d in 3d…
Watch this video and see if you can do it https://youtu.be/37hEX3Lrc0A
Or else right click on gameoverscreen and select save branch as scene. Then you need to use