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 Ryu-Ramasama · Sep 03, 2013 at 06:28 PM · multiplemesh colliders

Is it possible to have multiple Mesh Colliders on a Gameobject?

I'm making a procedurally generated 2D level for my game and I was wondering is it possible to have multiple mesh colliders on a game object. I'm trying to have areas in my level where there is water that the player can swim in so I need to set the collider to allow the player to pass through the actual water tiles. I have looked all over and there are no answers that come close to what I am looking for.

Comment
Add comment · Show 3
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 Fred_Vicentin · Sep 03, 2013 at 06:31 PM 0
Share

I think I don't understood, it's tile generated ? If yes, you can't put the collider on the generated object ? And instantiate the object as prefab ?

avatar image Ryu-Ramasama · Sep 03, 2013 at 06:44 PM 0
Share

The gameobject itself wont be instantiated. I should have worded my post better. I am generating the tilemap from a tile map editor I created. I want the tiles in the map to be linked to a mesh collider based on the value of a specific tile. So if the Tile is water it will be for $$anonymous$$esh collider 1# and if it isn't then it will be for $$anonymous$$esh Collider 2#.

avatar image Ryu-Ramasama · Sep 03, 2013 at 07:42 PM 0
Share

Well it seems that I will have to make a few child gameobjects to solve this problem since your not allowed to have multiple colliders of the same type on a gameobject. :(

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by ZenithCode · Sep 03, 2013 at 08:10 PM

You can have more than 1 collider on the same object but not of the same type. E.g. 2 mesh colliders.

My suggestion would be to NOT use a mesh collider. Use a box collider instead as its much better for performance. Also, as you said create a number of childobjects referencing the same material and mesh to create your water area.

Comment
Add comment · Show 5 · 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 william9518 · Sep 03, 2013 at 08:11 PM 0
Share

Yes you can have more than one collider! I got 8 on my player checking for multiple things!

avatar image ZenithCode · Sep 03, 2013 at 08:16 PM 0
Share

Edited my answer now. I wanted to say that he cannot have multiple mesh colliders on the same object although I still don't suggest having multiple colliders on the same object except in special cases.

avatar image Ryu-Ramasama · Sep 03, 2013 at 11:39 PM 0
Share

Oh ok thanks. The box collider would be a good Idea except I have the mesh for my tilemap being generated by code. So everytime i draw a new tile or draw over a new Tile I have to redraw the mesh and a single box collider wont work for this situation.

avatar image ZenithCode · Sep 04, 2013 at 05:46 PM 0
Share

So, is your problem solved now?

avatar image Ryu-Ramasama · Sep 05, 2013 at 11:23 PM 1
Share

Yes the problem is solved. I just added another tilemap to the scene. I figure I can use this for tiles that would be used for water. This would allow me to allow the player to do things like swim, float, or take damage.

avatar image
0

Answer by palbanagar · Jul 07, 2019 at 08:19 PM

select all the child objects with mesh and then assign a mesh collider. It will assign the respective mesh colliders to each one of them.,Select all the child objects and and assign a mesh collider. It wil assign the respective mesh colliders to all of them

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

20 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

Related Questions

OnTriggerStay2D not working 0 Answers

Best way to organize and access several distinct health values in one object 1 Answer

How do I display two scenes at once 1 Answer

please help me with AR multiple object 0 Answers

Two trigger activation. 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