Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | powderblue042 |
Hi everybody,
I’m brand new to Godot and learning slowly about the various features, so please treat me like I know nothing!
I need to get sprites to take actions when they are tapped via a touchscreen, how do I write code so that when the sprite is tapped it causes a response?
Thank you,
Powderblue042
in project settings set enable simulate touch on desktop and simulate mouse on moble
rakkarage | 2020-06-27 17:56
Hi rakkarage,
Thank you for the suggestion, I saw this in the tutorial selamba mentioned, the issue is whether tapping is treated differently from a mouse clicking and how to code it, for example it just appears, it doesn’t ‘enter’ the body of the Area2D node that I created from outside. I’m also not sure how to combine a mouse click with a check of whether the sprite is the one clicked. I’d also need to be able to tap where there are 2 or more sprites and tell Godot which sprite is being tapped, those are the two questions I need to find an answer for.
Kind regards,
Powderblue042
powderblue042 | 2020-06-27 21:25
Hey guys.
I found this video tutorial which helped a lot: youtube.com/watch?v=32VtGtVrOrw, but still not sure about the mouse vs. screen touch thing.
Kind regards,
Powderblue042
powderblue042 | 2020-07-04 11:58