Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 TheCradam · Jul 20, 2012 at 10:18 AM · meshcolliderstreecolliding

Tree colliders not working.

Hey I have been having trouble with adding tree colliders in my map. I have the "Create tree colliders" option checked, and have the "is triggered" box unchecked. I have no idea how to fix it, thank you.

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 Kryptos · Jul 20, 2012 at 11:07 AM 0
Share

Did you check the layer of the trees and the layer collision matrix?

avatar image ScroodgeM · Jul 20, 2012 at 10:19 PM 0
Share

how do you check theese colliders?

avatar image the_Simian · Aug 07, 2012 at 07:22 PM 0
Share

Any luck with these fixes? Hows it co$$anonymous$$g?

4 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by ffxz7ff · Jan 11, 2014 at 01:44 AM

I know this topic is old, but it's also unanswered and I struggled for a few hours tonight, trying to solve the same problem. Am I assuming correctly that you were trying to add trees to an existent terrain after its creation?

The problem is that the Collider doesn't update automatically. After adding the trees, I did this manually by doing the following:

terrain.GetComponent-TerrainCollider-().active = false;

terrain.GetComponent-TerrainCollider-().active = true;

(replace - with pointed brackets, can't write this here)

And now it works properly. There might be a better way to do this, but this is what works for me so far.

Comment
Add comment · Show 3 · 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 AlucardJay · Jan 11, 2014 at 03:19 AM 0
Share

Why not format the code?

 terrain.GetComponent<TerrainCollider>().active = false;

 terrain.GetComponent<TerrainCollider>().active = true;

You can do this by highlighting all your code, then clicking the 10101 button at the top of the edit window.

  • http://answers.unity3d.com/page/newuser.html

  • http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

avatar image ffxz7ff · Jan 11, 2014 at 04:41 PM 0
Share

Ah alright, thank you. I tried to format it properly but for some reason I couldn't get it to work last night. :)

avatar image ms502040 · Feb 05 at 02:06 PM 0
Share

working in unity 2021.1 too. Add it to awake function and attach to terrain object.

avatar image
3

Answer by the_Simian · Jul 23, 2012 at 04:17 PM

I've had this problem. All you need to do is add a prefab for the tree, and then add a capsule collider for the trunk of the tree. This way the "leaves" can still be walked through, but the trunks will prevent you from walking through.

Heres the process:

  1. Find the tree you want in the Project panel.

  2. Drag it out as a prefab onto your scene anywhere

  3. Select the tree, then add: [Components menu -> under Physics, -> capsule collider]

  4. Set the radius of the collier to match the trunk (for me it was about 0.7 on the radius)

  5. Make a new prefab, by dragging this "capsule collider'd" tree back to the original

  6. use this new tree in the terrain Painter.

Place a few trees, and you should be ready to go! Can't walk through the trunks now!

If the tree has any other large branches you don't want to be able to walk through follow the same process and add additional colliders on them.

Its easy!

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 dimmduh · Mar 21, 2015 at 12:37 PM 1
Share

It's not necessary to create new prefab, just press "apply" button at the top of object inspector

avatar image the_Simian · Mar 21, 2015 at 07:27 PM 0
Share

@dimmduh thank you for the update. $$anonymous$$y answer is 2-3 years old now, and there are probably better ways now.

avatar image
3

Answer by AnoyRC · Jan 18, 2018 at 06:56 PM

Another easy way: 1.Select the prefab from where you have selected the tree. 2.keeping the prefab selected in asset browser, in inspector, add component mesh collider or box collider or capsule collider and it's done...

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
1

Answer by ThatUnityNoob · Jul 23, 2012 at 03:39 PM

I have had the same problem before...What I did that ended up working was I put down the prefab of the "tree" I was using, then I put a box collider on it and positioned it corectly around the tree. Then I saved it as a diffent prefab and used it as the tree for the terrain. It worked fairly well.

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

12 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

Related Questions

Populating terrain with building as trees causes them to clip,How to mass plant buildings as trees in a terrain? 0 Answers

Applying mesh colliders to all models in a scene 0 Answers

To what extent can the tree system be used instead of the details system 0 Answers

Detecting objects between camera and mesh 0 Answers

Attaching multiple rigidbodies together and spawnning as prefabs 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