Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mist |
Hello, guys. I have several prefabs (Hierarchy is: Area2D → Sprite | CollisionShape2D(rect)). I need to be able to move these objects. I did not work my way, I joined in Area2D signal input_event, here is the code he is not even included in the function and says nothing.
func _on_Area2D_input_event(viewport, event: InputEvent, shape_idx):
$"../UI/Control3/Label2".text = String(event.as_text())
if event is InputEventScreenDrag:
$"../UI/Control3/Label2".text = String(event.position)
How can this be realized? This should be on a mobile device in the future.