Topic: Marker Rendering Order Issues
Hey there ![]()
In our Unity game we have a custom marker sorting system where unsolved quest markers (priority 1) should always render on top of solved quest markers and team markers (priority 0) because sometimes when a team walks exactly to the quests location, the team marker overlaps the quest marker and blocks it from being clicked. This works correctly in some games but not consistently across all game types.
What We've Discovered:
1. Our Implementation:
- Custom IComparer<OnlineMapsMarker> that sorts by priority (unsolved = 1, solved/team = 0)
- Assigns markerComparer to OnlineMapsMarkerFlatDrawer
- Uses map.Redraw() to trigger re-sorting
2. How we think OnlineMaps v3 works Under the Hood:
- Markers are grouped by texture when creating materials
- Each texture group gets its own material/submesh
- Unity renders materials in the order they appear in the material array
- Click detection uses the original marker list order, not the visual rendering order
3. Our Attempted Solutions:
✅ Working: Custom MarkerComparer correctly sorts markers for visual rendering
❌ Problematic: Material reordering via OnSetMarkersMesh callback works visually but..
❌ Issue: Click detection doesn't match visual order when markers overlap (can't click my quest when there is another marker below it visually)
Current Status:
- Visual sorting works correctly (unsolved markers render on top)
- Click detection sometimes fails when markers overlap because hit-testing uses unsorted marker list
- Material order changes dynamically during map interactions
Questions:
OnlineMaps v4: Does v4 have better marker management that would solve this issue more elegantly?
OnlineMaps v3: Is there a built-in way to ensure marker click detection matches the visual rendering order?
Best Practices: What's the recommended approach for implementing custom marker sorting in OnlineMaps v3?
Technical Details:
- Using OnlineMaps 3.7.15.1
- Using OnlineMapsMarkerFlatDrawer with custom markerComparer
- Markers use different textures (team, solved quest, unsolved quest)
- Need unsolved quest markers to be both visually on top AND receive clicks when overlapping
Any insights or solutions would be greatly appreciated!
I hope the text is understandable ![]()
Have a great day!
Robert