Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by skunity3D · Feb 03, 2015 at 02:40 PM · meshcolliderscollision detectionmeshcollidercollisions

Collision with Plane fails

Guys I just encountered following issue.

I have a camera inside sphere, in fact center of the sphere and which acts as a first person view, wrote a script to move the sphere front, back, turn left and turn right using keyboard arrow keys. For moving forward and backwards, I am using transform.Translate with steps of 0.1f units.

Scenario : Glass Window from fbx (3DsMax) and applied mesh colliders in unity In this setup I got a fbx of a warehouse from a friend, and imported into unity. For the glass windows in the walls of the warehouse model, my friend used planes and transparent texture, and I applied mesh collider to those glass windows planes in unity.

Now when I am inside of the warehouse and while pressing the up arrow key, the sphere moves forward, and it just simply passes through the window, out of the warehouse and when I turn back and try to enter from the same window (through which I just came out) from outside of the warehouse, the collision occurs and it prevents me from entering.

I am bit confused why even after applying mesh collider, the collision is detected only on one side of the plane. Which means I can pass through let say side A to side B of the plane, but it detects collision while moving from side B to side A.

Please advice for what could be done so that the collision occurs on both the sides of the plane?

Regards,

Comment
Add comment · Show 4
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 taxvi · Feb 03, 2015 at 02:44 PM 1
Share

use a thin box collider

avatar image skunity3D · Feb 03, 2015 at 05:46 PM 1
Share

Thank you Taxvi. Yes indeed I did test with that option as well, and it worked.

$$anonymous$$oreover I tried turning on the convex option for mesh colliders, but it gave me irregular polygon shapes which might not suit for every situation. $$anonymous$$ay this work for flat planes, but what about some 'L' shaped geometry, so convex may not be the solution everytime.

And consider a scenario where there are hundreds of such items, glass windows, thin sheets of different metal, thin wall in your scene. And applying box colliders to every one of those planes would surely become very cumbersome and may become tedious down the lane.

I am looking for a more generic approach which could save both artist and programmers time.

Regards,

avatar image taxvi · Feb 03, 2015 at 08:40 PM 1
Share

hey, thanks for sharing. As much as I know colliders are ok, but using too many rigidbodies will kill the performance. but good for us unity shuts off motionless rigidbodies until they collide with something, so basically you can have tons of those as long as only limited amount of them are awake at all times. I'm rephrasing from Unity $$anonymous$$anual's Rigidbody Sleeping

avatar image DanSuperGP · Feb 03, 2015 at 08:48 PM 1
Share

You should always prefer box, sphere, and capsule colliders over mesh colliders if possible, they are much more efficient.

If you want to make something L shaped, it's better to use multiple box colliders than a mesh collider.

0 Replies

· Add your reply
  • Sort: 

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

21 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

Related Questions

Translating an object along a line until it collides with other objects 1 Answer

All colliders no longer work. 0 Answers

Editing Mesh Colliders? Creating a usable pot/cup 1 Answer

Colliders on this spider 1 Answer

How to correct add collider to every child of gameobject? 1 Answer


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