Spawn Polyline On Click of POI
Note: If this is a bug or support ticket, please provide the following information: Unity version: 2017.3 Mapbox SDK version: 4.1 The platform you're building to: iOS Xcode
I am looking for a way to spawn a polyline or polygon from my layers when a game object is clicked
To be more specific, I will have a POI game object for a "Trail" when the user touches the POI the polyline for the trail will animate along with an info window that tells about the trail. Thank You!
If I understand it right, it's an application issue (more than SDK) but assuming you're using custom tilesets for both points and trails, I think you can do something like;
- create trail poi tileset, add a unique property to each poi
- create trail tileset, add unique ids same with their respective pois (so one poi will have same id with one trail)
- create trails as regular lines but change the gameobject name to that unique id (you can do this in any gameobject modifier manually) and disable itself (so they won't be visible initially).
- create pois. add a monobehaviour on prefab to find trail by name and enable it
this is a not the best way to do it really but I think it's the most straight forward one. Let me know if you have problems but basically it'll be much easier if you get familiar with "game object modifiers".