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 AKJ9 · Sep 11, 2014 at 12:20 PM · collisionphysicstexturecollidermodel

How to automatically add physics/colliders to a model of a map

Hi there,

I have a 3ds model of a village and have imported this onto my scene. As originally anticipated, I knew my character would simply fall/walk through everything. For now, I've added a plane on the floor so that he can at least tread the village's surface.

I wanted to know if there's any possible in-built mechanic or efficient way of adding the necessary physics/colliders to my village model? I really want to avoid adding physics/colliders to every element of the village (such as fences, houses, slopes, hills etc). Is there a way of Unity detecting objects and obstacles of this model?

Many thanks for your time in advance.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by VesuvianPrime · Sep 11, 2014 at 12:23 PM

As a temporary measure you can use a MeshCollider

With regards to adding colliders to the individual pieces that make up your terrain, I think you're either going to have to go fully automatic or fully manual.

You could recurse through the asset tree and add collision boxes to each item, or you could manually go through the tree and add colliders to each item. I'm not sure there is a half-way solution here.

Comment
Add comment · Show 6 · 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 AKJ9 · Sep 11, 2014 at 12:48 PM 0
Share

Thanks for your reply @VesuvianPrime. I've added a $$anonymous$$esh Collider, but my character can still walk through things. Is this something to do with the $$anonymous$$esh and/or $$anonymous$$aterial fields? I've read the documentation and cannot extract any useful information from it to solve this problem.

Also, what do you mean by fully automatic? I understand what you mean by manually doing this, but what you've described as automatically doing it sounds the same as manually doing it. Thanks.

avatar image VesuvianPrime · Sep 11, 2014 at 01:20 PM 0
Share

You will need to assign the terrain mesh to be the collision mesh on the $$anonymous$$eshCollider to get anything useful out of it.

By fully automatic, I mean writing an editor script to loop through the asset and add colliders. Honestly, it would probably take longer to write the script than to do it manually. Besides, with the manual approach you'll be able to get the colliders exactly as you want them.

avatar image AKJ9 · Sep 11, 2014 at 01:31 PM 0
Share

I see, thank you. I'll avoid the automatic method and do it manually if this $$anonymous$$eshCollider method doesn't work.

With regards to the $$anonymous$$eshCollider method, apologies for the rookie question, but where do I locate the terrain mesh for this model? When I've created actual terrains in the past, the terrain mesh for each is present. However, as this is simply a 3ds model (GameObject), I believe there is no terrain mesh allocated to it.

Thanks for your support and swift replies.

avatar image VesuvianPrime · Sep 11, 2014 at 01:44 PM 0
Share

If you look at your GameObject you should see a $$anonymous$$eshFilter Component. This $$anonymous$$eshFilter will contain the $$anonymous$$esh that represents your terrain. If you click the $$anonymous$$esh it should highlight the location in the project view.

Alternatively, if you click the dot next to the $$anonymous$$esh field in the inspector it will open a new menu that lists all of the $$anonymous$$eshes in your project. You can search and filter through this to find your terrain mesh.

avatar image AKJ9 · Sep 11, 2014 at 02:26 PM 0
Share

Nearly there! So I've located the $$anonymous$$esh that was in the $$anonymous$$eshFilter component of my GameObject. However, this is not the mesh that represents my entire terrain, rather only a small door/sign of the terrain (strange).

Regardless, I found a $$anonymous$$esh that captured a lot of the terrain, but still not all of its entirety - I've assigned this to the Collision $$anonymous$$esh field anyway. As we can only assign one $$anonymous$$esh to the Collision $$anonymous$$esh, would this mean I'd have to create manual colliders for the remaining objects? $$anonymous$$any thanks.

Show more comments

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Disable/Enable Colliders 1 Answer

No Collision 3 Answers

object goes through another object error 1 Answer

Is there anyway to see if another Object has any Collision? 1 Answer

How to check if two objects are mutually ignoring collision? 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