- Edited
I had written a code which was working perfectly but suddenly it stopped working. Still works when I emulate mouse touch in my PC.
Here is the code
extends Node
var touch_col
var is_active = false
var evt
func _ready():
touch_col = get_child(0).get_child(0)
touch_col.disabled = true
func _process(_delta):
if evt != null:
get_node("TouchInput").global_position = evt.global_position
func _input(event):
evt = event
if event is InputEventScreenTouch:
print("OK")
is_active = !is_active
if is_active:
touch_col.disabled = false
else:
touch_col.disabled = true