i seem to have an error help...

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By idkidkidk

extends Sprite

var popup = false

func _ready():
if Input.is_action_just_pressed(“ui_end”):
var popup = true
get_node(“777”).show()

func _popup():
var popup = false
get_node(“777”).hide()

	
im trying to make  a sprite to show when i press button end and hide it when i press the same button end

So you’re accessing the hide() / show() functions of the sprite, and making it appear or disappear with the press of a button? Have you tried something like:

 func _process(delta):
   if Input.is_action_just_pressed("ui_end"):
      If get_node("777").is_visible():
         get_node("777").hide()
      else:
         get_node("777").show()

Ertain | 2019-04-28 22:57