Hello, I have an issue trying to use a model from the Unity Asset Store: Sci-Fi Styled Modular Pack. I don’t know how to fix it. Basically, I’m trying to use this asset, and it looks fine when I’m using it in Unity, but in the browser, it looks bad with some white dots. I’m also getting two warnings in the console:
Warning 1:
vconsole.min.js:10 Your MeshCollider “window_big_complete_(3)” is scaled (2.0000001007665515, 2, 1.0000000503940163). This is not optimal for performance since it isn’t supported by the Rapier physics engine yet. Consider applying the scale to the collider mesh.
Warning 2:
vconsole.min.js:10 MeshCollider mesh is a group “window_big_complete_(4)”, adding all children as colliders. This is currently not fully supported (colliders cannot be removed from the world again). MeshCollider {__context: _Context, __name: ‘MeshCollider’, gameObject: Object3D, guid: ‘d8e2534e-896e-521d-9850-74b0ed2c19b1’, sourceId: ‘assets/sampleScene.glb’, …}
I really don’t know how to fix it. Apologies in advance, I’m new to this. Can anyone help me?
Original Post on Discord
by user 691445074055397447
Hi, the warnings are due to the physics engine (rapier) not being able to apply scaling to mesh colliders automatically right now - to still make it work we do copy the mesh in those cases, scale it and then give it to rapier for creating the collider shapes. Depending on the complexity of the colliders (and the amount) it can hurt performance. It depends on your scene really.
Regarding the dots: Which material are used on those meshes in Unity? Are they transparent by any chance? And did you use any other rendering feature here (like lightmapping) ?
They use different materials like this, but the majority, if not all, have a white material, which is this one
by user 691445074055397447
Another question, and if it’s not too complicated, how could I do this “to still make it work we do copy the mesh in those cases, scale it and then give it to rapier for creating the collider shapes.”?
by user 691445074055397447
To avoid this you’d have to have all Gameobjects set to scale 1,1,1 in Unity. That would remove the need to scale mesh colliders. Otherwise you could replace the colliders with Box colliders if possible. But it might not be a big problem (your scene looks not very high poly) since it only happens once per mesh
Oh, okay, perfect, thank you! Do they all have to be at that scale, or can some have a slight difference in size
by user 691445074055397447
Don’t think you actually need to do anything - we make it work and just warn that the mesh is copied
Can you send us a bug report with that scene? I’ll need to look at the material and mesh settings to understand if we can improve the material export for that case.
That being said, values like normalScale=-0.1 may just lead to garbage results, I don’t think that’s well-defined in Unity either
Sure, no problem. How could I send the bug report? Through Discord or your website? Thank you very much for your help, truly appreciated
by user 691445074055397447
You can send a bugreport via Unity using our menu item “Needle Engine/Report a Bug/Current scene”
ok ok thank you !
by user 691445074055397447