When exporting the game to the android platform, the game actions are not performed correctly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hernán Montes

I’m making a game that consists of dragging objects and placing them in the right place (puzzle type). Once it is assembled, you will see a flow chart.
When I run the program on my computer it works perfectly, but when I want to export the game to android, it exports without any error.
I install the game in my cell phone, it loads correctly, but when I get to the scene where I have to select the object and drag it to the right place is the problem, because in the first instance you can’t select the object immediately, then if you want to choose another object in logar it’s impossible.
You can see it better in the video that is in this direction:
https://youtu.be/ycDcHgcJq6o

Please, if you can help me correct this mistake.

You can find the coding at the following address for download : http://programacionybasededatos.vzpla.net/godot/practica_en.html

The project link at the above address just leads to a 404 error…

jgodfrey | 2020-03-07 15:21

http://programacionybasededatos.vzpla.net/godot/archivos/dfd_v1/dfd_suma3_v1.zip.tar
:wink:

Didn’t check the whole project but I had a short look at “obj_script_DnD.gd”

At least the functions _on_area_mouse_entered/exited won’t work (unless you actually attach a mouse to the android device). Android touch screen won’t generate a mouse over as they don’t notice your finger hovering over the display.

Any mouse click and move events are only emulated (if checked in the project settings) by godot using touch events.

Also Drag & Drop is difficult on touch screen devices. Unless the dragged item is bigger than your finger. Maybe you could enlarge the object while it is dragged.

wombatstampede | 2020-03-07 16:14

:bust_in_silhouette: Reply From: Hernán Montes

Excuse me, I understand that this is not impossible to perform on an Android device.
Could you suggest other possible alternatives to what I’m developing?

Drag and Drop is possible on Android/Touchscreen devices. But it has to be changed/adjusted or replaced which another method.

This also depends on the size of the device and the complexity of the drag & drop sources and targets. And some ideas may seem useful but may not be very intuitive.

Drag & Drop may work well on a 13" tablet but it may be nearly impossible to perform it on a 5" phone screen.

I would think of a solution like that:

  • #1 You select one item by touching/clicking it.
  • Then the item will be highlighted.
  • The possible “drag” targets are clearly marked. (Maybe with animated pointers or similar).
  • #2 You touch/click one of the targets

wombatstampede | 2020-03-08 09:36

Thank you so much for your help.
Can you help maybe with a sample suggestion?

Hernán Montes | 2020-03-08 21:45

I don’t have a sample for that at hand.

I can only link to a classic drag & drop example here:
https://github.com/godotengine/godot-demo-projects/tree/master/gui/drag_and_drop

wombatstampede | 2020-03-10 07:17