Hi,
I want to implement a simple mechanic to draw a route while user holding left mouse button or tapping on the screen. To illustrate what I mean - here is the image.
The user should be able to draw only on roads areas, and not everywhere.
I am not sure what the right approach to implement it, I guess I need to create a mask for the map so the input will be only available on the roads location or something. I’ve implemented a simple route drawing via factory spawning of “path pellet” game object on mouse click and hold, so it kind of draw a path but I don’t know how to restrict object spawn area so I can spawn (draw) “path pellet” objects only on the road areas?
here is how I can draw on the map now