I am making a city builder. i got it to open a menu that shows what buildings can be made then you select a building and press a build button that spawns it( note additional question below) and closes the menu.
now i want to make it so if the player taps on the building it will allow it to show ui for info and if it taps and drags to move the building.
So do i need to make the building a button? or is a raycast a good way and how to use in mobile?
Additonal question:
when i spaw a building it spawns it under my ui node is there a way to spawn it in my world? where i have my tile map etc?
func _input(event):
if event is InputEventScreenTouch:
if get_rect().has_point(to_local(event.position)):
print(“You clicked on Sprite!”)
its in a script attached to a sprite 2d node but the sprite 2d is a child of a static body.
after experimenting more it seems the area to click is way far left of the sprite.