I am trying to build a simple city-builder game.
Is there a way to spawn an object on the X, Y coordinate that was just touched?
Develop games in your browser. Powerful, performant & highly capable.
Create the condition "On any touch start" (if you want the object to be created as soon as the player touches the screen) or the event "On any touch end" (if you want the object to be created as soon as the player lift his finger).
Then inside this condition you create the event system > Create object.
Create object function takes 3 parameters.
The first one will be the name of the layer you want your object to be created.
The second and third one will be the X and Y of the object, in other words,it'll be the coordinates on the screen where your object will be created.
Set x to "touch.x" and y to "touch.y"
And that's it ^^
hope it helps