MeshCollider Updating Issue (originally: QBfile Import problem)

0
metalgeni posted this 17 June 2015

Hello.

After creating the Volume in Unity has confirmed that explode on PicaIslands well run.

However, creating the Volume using the QB file Collider does not disappear after explode.

Why is this?

Last edited 19 June 2015

6 Comments
Order By: Standard | Newest | Votes
0
GarethIW posted this 17 June 2015

Okay, I found a really weird bug based on your description, but I'm not sure if it is your issue or not. This is not limited to Qubicle imports as it happens on a blank scene with one new Volume and an exploder set up. It oddly doesn't happen in the Islands demo.

Basically, it seems like updating mesh colliders was always one update behind the rendered mesh. This meant that an explosion would cause chunks to completely lose their collider until the next time they were updated (exploded).

I'm quite surprised this hasn't been reported before - I certainly have never noticed it which is really odd and makes me believe it's a recent change in Unity.

I need to do some more testing, but here is a fix that I have confirmed working in Unity 4 and 5. Update Chunk.cs to the following: https://gist.github.com/GarethIW/6c9b32409c84d49bea9f

If this does not fix your issue, please explain with screenshots or a video and I'll take a look.

0
metalgeni posted this 18 June 2015

Unusual thing is if the QB File Import When the Voxel size is NOT default value (not 0.1),

After successfully destroyed, First Person Controller can pass the area.

But when Import to the default voxel size (0.1) does not.

the operation should not be in both Mesh Collider Convex, Concave.

I think It maybe bug.

I working in Unity 5.

Thank you.

0
GarethIW posted this 18 June 2015

Ahh, I think I figured this out now. If a chunk was being completely destroyed in one explosion (as in, no voxels were left in the chunk), the collider mesh was not being cleared. This would explain why a larger sized voxel wouldn't have the problem, because a single explosion wouldn't be destroying all of the voxels in one chunk.

I have updated the fix in my last post. Note that the code is only compatible with the latest release (1.3) of PicaVoxel.

0
metalgeni posted this 18 June 2015

I already use PicaVoxel 1.3.

The easiest way to test is import the QB file that there is only one Voxel,

You can see Collider does not disappear.

Thank you.

Last edited 18 June 2015

0
GarethIW posted this 18 June 2015

Can you try this fix to see if it solves your problem? https://gist.github.com/GarethIW/6c9b32409c84d49bea9f

Replace all of the code in Chunk.cs with that code.

1
metalgeni posted this 19 June 2015

Thank you for your response.

I changed the code again the issue has been resolved.

PicaVoxel is a great Asset.

Thank you.

Last edited 19 June 2015


Our 123 members have posted 454 times in 109 discussions