- Home /
How do I make an interactive map on Unity?
I want to make a map in Unity. The player should be able to click anywhere on the map an be able to travel freely in a straight line.
My plan for the implementation is once he chooses where he will travel to, to then procedurally generate 2D platform terrain.
This is a map I've taken from the internet but it can represent what I'm trying to make it look like:
I've tried looking for tutorials on the internet on how to make similar kind of maps, but the only one that was remotely helpful was one I watched made by quil18 where he makes a grid and then assigns portions of the grid to correspond to sections of the map. (Perhaps in this case that would be the rectangles on the map) This is however, not what I was searching for.
Imagine that the player selects these two points: I would like to create a connection between them and then generate terrain. I was thinking of having something like a plane, and then using Rays to find some kind of coordinates. Let me know if you think that could work. A problem I have with this implementation is if the path goes through water or other impassable terrain. There should be some kind of detection.
p.s. I thought about it and I think that's not that big of a problem. If I make it so that the map is fully interactable and not a grid for example, I can make a pathfinding algorithm that draws lines, that avoid obstacles.
Anyway, these are just ideas and the problem is I haven't done anything like this before. If you have any ideas please share them with me. The thing I need the most is tutorials which have similarities with this. There probably aren't many, but anything you send is going to be of help. Thank you very much!