mapbox / mapbox-unity-sdk

Mapbox Unity SDK - https://www.mapbox.com/unity/
Other
725 stars 210 forks source link

Terrain Options Add Collider doesn't work #1234

Closed citizen12 closed 5 years ago

citizen12 commented 5 years ago

No colliders are added to the Mapbox-generated terrain Game Objects, even when you ask for them.

Expected terrain GameObjects to have Mesh Colliders when Add Collider was chosen.

citizen12 commented 5 years ago

Apparently, it does not work when you have your elevation layer type set to Flat Terrain.

das-friday-night commented 5 years ago

I met the same problem. At this moment, It seems that Possible bug in CitySimulatorMap #1185 didn't provide any solution to this problem yet. Here is my investigation. After hitting play on unity, then uncheck and check back "Add Collider", I found the mesh colliders were added to all the vector tiles successfully. My guess is that Mapbox SDK does not execute public override void UpdateProperty(UnityTile tile) to check whether "Add Collider" was checked in initialization stage. And this function is located at "Mapbox/Unity/DataContainers/TerrainColliderOptions.cs".

tab1887 commented 5 years ago

I'm facing the same issue. Has a fix been provided yet? I can't find any commit with this issue number.

DianaDI commented 4 years ago

I am facing still the same issue. Please help to resolve.

brnkhy commented 4 years ago

Hey @citizen12, @siyuan-li, @tab1887, @DianaDI ticket was closed so I didn't see it for a long time. Checked this today and I think this should fix the issue; https://github.com/mapbox/mapbox-unity-sdk/tree/flatTerrainColliderFix

DianaDI commented 4 years ago

@brnkhy Thanks a lot! Actually, I made a temporary solution by adding "invisible" terrain with a collider.

brnkhy commented 4 years ago

@DianaDI very happy to hear that! Also that might even be better if it works for you. One box collider for whole terrain. but of course we have to think about many other stuff like, loading/unloading tile etc etc. so I had to go with per-tile for now.

yosun commented 4 years ago

Still seems to be an issue with latest Mapbox Unity SDK... flat terrain has no colliders

yosun commented 4 years ago

Workaround - lowpoly terrain, exaggeration factor 0

brnkhy commented 4 years ago

Hey @yosun! This commit should fix it; https://github.com/mapbox/mapbox-unity-sdk/commit/79664cc3329e7525344bb713fd21d167b55febcb We haven't had a release after that so it is broken in package but should be fixed in dev branch.

yosun commented 4 years ago

Hey @yosun! This commit should fix it; 79664cc We haven't had a release after that so it is broken in package but should be fixed in dev branch.

wow that has been over a year with no updates to the release branch! oh no - is Unity support being deprecated?

brnkhy commented 4 years ago

@yosun last release was 2019 October I believe and I have been pushing fixes to dev branch this year but got tied up with some bigger stuff at the moment (performance improvements). So we are active at the moment :)

sgtrusty commented 3 years ago

Still broken ... Why is this closed? Using yosun's solution meanwhile.

sethHex commented 2 years ago

this is still not working?