![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | BarbOn |
I’m trying to make touchscreen controls on my game for android , i added a new input in the InputMap called “click” that is simply the left click of the mouse.
Now on PC the controls work very well but after exporting to android the mouse emulation from touch seems to not work at all
Here’s the code for the controls:
extends Node2D
var first_point=Vector2(0,0)
var second_point=Vector2(0,0)
func _physics_process(delta):
update_position()
pass
func update_position():
if(Input.is_action_just_pressed("click")):
first_point=get_viewport().get_mouse_position()
self.show()
if(Input.is_action_pressed("click")):
var app=get_viewport().get_mouse_position()-first_point
second_point=app
else:
self.hide()
first_point=Vector2()
second_point=Vector2()
Here’s a video that shows that on PC works normally