+1 vote

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.

in Engine by (21 points)
retagged by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.