mapbox-unity-sdk
mapbox-unity-sdk copied to clipboard
How to center a gameObject in a road
Hi, Can anyone tell me how I can center a gameObject (for example a vehicle) in the middle of the closest road?
@DuarteBarbosaPT there isn't an easy way to do it. SDK has a system to process road data and that's pretty much all. What you need to do is;
- Keep track of them all, probably in a quad tree like structure to be able to query by location.
- Then query that structure to find the closest road segment to the given point.
- And finally create your gameobject in the middle of the found road segment. hope that helps.