I created scene with complex button. When you touch it. Joystick appears and button disapears. Then you can swipe to any direction. Everything in 1 motion and last position saves in Global variable. joysticks hides and button appears again.
extends Control
var pressed = false
func analog_force_change(inForce, inAnalog):
if(inAnalog.get_name()=="AnalogRight1"):
if inForce.x == 0 and inForce.y == 0:
get_node("Button").show()
get_node("AreaAnalog").hide()
pressed = false
get_node("Button").release_focus()
Globals.set("action1",Vector2(inForce.x,inForce.y))
func _on_Button_mouse_enter():
if pressed == true:
get_node("AreaAnalog").show()
get_node("Button").hide()
func _on_Button_focus_enter():
pressed = true
Everything works as I typed above. The problem is when I try to instance these nodes to another scene...Its far away from working. No value in Global and joystick stays visible. Even it feels very different and ALL I did was instanced fully working button scene...