Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
6
Question by N-Dream-AG · Sep 13, 2017 at 12:55 PM · physicseditorwebglmesh colliderbox collider

In WebGL build, Rigidbody only collides with Mesh Collider if it has previously collided with Box Collider

I have an issue where my collisions are ignored in the WebGL build, even though they work in the editor.

Here's what's happening:
Example 1: https://gfycat.com/RemoteTanAfricanharrierhawk
Example 2: https://gfycat.com/NervousDeliciousKoi

The tank GameObject is a Rigidbody with Capsule Colliders. The orange "floor" is a Mesh Collider, that white thing is a Box Collider.

If the Rigidbody 'touches' a Mesh Collider for the first time, it falls through, there is no collision.
If the Rigidbody first collides with a box collider however, the collision works, and after that it also collides as it should with Mesh Colliders.

In the Unity Editor, all collisions work as they should.

The issue is the same with both Convex and non-Convex Mesh Colliders.

My workaround for the moment is just to place an extra box collider for the Rigidbody to collide with "first", but that can't be the best solution to this. Any ideas?

Edit: I tested some more, and this also happens in an entirely empty project with just one Mesh Collider and a Rigidbody (Sphere) in it. Even more strangely, the angle of the Mesh Collider makes a difference: As soon as the mesh collider is rotated a little, the collision works as it should.

Example 3: https://gfycat.com/FormalAccomplishedBluebottle
Example 4: https://streamable.com/4y0k0
(only mesh rotation changed between these two).

In my own project, the collision also works when I rotate the "floor" mesh slightly. Is this a bug or is there something I'm missing here?

Edit 2:
Link to build: http://aliceruppert.ch/files/unity-test/index.html
Link to project folder: https://drive.google.com/open?id=0B1LEzX86fi3pTnFFOHU1UTFWelk

It seems to be an issue specific to meshes made in Blender.

Edit 3:
Another test build: http://aliceruppert.ch/files/unity-test-2/index.html
Happens both with .blend files as well as blender fbx exports, but not with Wings3D, for example.

Edit 4: The issue does not happen with an obj file exported from blender, so the problem is somewhere either in the Blender export or the Unity import...

Comment
Add comment · Show 14
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hexagonius · Sep 14, 2017 at 08:24 AM 0
Share

Are you certain all normals point outwards everywhere?

avatar image Mike-Geig ♦♦ · Sep 14, 2017 at 02:34 PM 0
Share

Added on Twitter as well: "It seems like the rigidbodies are starting off "asleep". Hitting the box collider wakes it up while the mesh collider does not. Looking into it"

avatar image Marco-Trivellato · Sep 14, 2017 at 03:28 PM 0
Share

Are you sure this is only affecting WebGL builds ?

avatar image N-Dream-AG Marco-Trivellato · Sep 15, 2017 at 08:35 AM 0
Share

At the very least, it does not happen in $$anonymous$$ac OSX builds (as in: collisions are working normally there). That's the only other one I could try right now.

avatar image AlexKolosov · Jan 20, 2018 at 11:05 AM 0
Share

Hello. I have same problem. Standalone and Editor work, but webgl no. Standalone build: https://youtu.be/Jbb3I8Rg$$anonymous$$w8 WebGL build: https://youtu.be/PcYLOtjYqCc

avatar image Dani-Desa AlexKolosov · Apr 24, 2018 at 09:52 PM 0
Share

I'm having the same issue, I don't know how to solve it and my game rely entirely on one mesh collider. Editor and standalone is fine, webGL broken!!! :(

avatar image AlexKolosov Dani-Desa · Apr 25, 2018 at 06:29 AM 0
Share

I'm sorry, but the problem has not been solved yet.

avatar image Dani-Desa AlexKolosov · May 26, 2018 at 07:10 AM 0
Share

Yep, I end up replacing my mesh collider with a capsule collider, not the best but it works..

avatar image U92 AlexKolosov · Feb 26, 2019 at 04:28 AM 0
Share

did you find a fix for this? I was making a pinball game.

avatar image Dani-Desa · Apr 24, 2018 at 09:56 PM 0
Share

I'm having exactly the same issue and my game relies entirely on one mesh collider! :( I don't know how to solve it... I tried different combinations/options. Nothing. Any idea what we can try?

Show more comments

4 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Schubkraft · Sep 18, 2017 at 01:19 PM

Hi, I took a look at your project and can repro this.

Can you be so nice to make a bug report from the linked project to also include the last scene you linked here with all the export options and the original blend file? Thanks!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image N-Dream-AG · Sep 19, 2017 at 09:13 AM 0
Share

Thanks for the response. Bug report has been filed.

avatar image
0

Answer by Schubkraft · Sep 20, 2017 at 01:19 PM

Update from our end:

1) This is a precision issue that we can't easily fix for WebGL/JS. Sorry.

2) You can workaround this by changing the Fixed Timestep physics settings.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image N-Dream-AG · Mar 28, 2018 at 09:15 AM 0
Share

$$anonymous$$y workaround is placing a box collider for the rigidbody to collide with first, because then subsequent collisions with mesh colliders work.

Changing the Fixed Timestep did not solve the problem for me, nor would I want to simply do ALL physics calculations more often, for performance reasons.

avatar image Dani-Desa · Apr 25, 2018 at 11:58 AM 0
Share

I cannot believe that this issue has no fix, it looks like a big issue to me. Who is not using a mesh collider for their games in webGL... I'm surprised the close the bug like that. There must be a workaround or something. Should I change the shape of my object for this? I don't want to go for that drastic measure.. Should I re-open the bug to Unity?

avatar image
0

Answer by Kjelle69 · May 30, 2020 at 11:09 AM

The trick with the "Hit a Box Collider first" really works @N-Dream-AG . :-)

I must have gone through a hundred posts about this issue before I came to this post with your random researched solution of the problem.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by kkaehler · Dec 03, 2021 at 12:02 PM

The workaround "collide with box collider first" just saved my project. Huge thanks, @N-Dream-AG! I wonder how the root cause can be a precision problem.

I have to add: how this issue is handled or better not handled is deeply disappointing. It's been around for 4 years?!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

144 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Release Note tracking for specific platforms such as WebGL 0 Answers

Can you get a visualization of joint limits in the editor as you set them up? 0 Answers

Unity 5 project freeze after switching to WebGL 0 Answers

Compute mesh inertia tensor failed - NOT the usual problem 0 Answers

Problems with mesh collider 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges