• 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 ExtremePowers · Nov 03, 2014 at 04:50 PM · physicscollidertree

Tree colliders

How can I make my tree have colliders? The main problem is that my trees aren't a normal tree with billboard leaves.

EDIT: I found out that my problem lies in the treeprototypes, because when adding it through them them at runtime there isn't a collider, but when manually adding it to the terrain using the brushes there is colliders.

It is this kindoff tree: alt text

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 ExtremePowers · Nov 04, 2014 at 03:36 PM 0
Share

@$$anonymous$$rSoad Huh, that's odd. I couldn't walk through the exact same prefab if I manually added it like you said, but when adding it through a treeprototype, it's like the collider disappears.

avatar image MrSoad · Nov 04, 2014 at 04:17 PM 0
Share

What do you mean by treeprototype?

avatar image ExtremePowers · Nov 04, 2014 at 04:21 PM 0
Share

I am adding it through script, like this:

     var treeProtoTypes = new TreePrototype[tree.Length];
     
     for (var o = 0; o < tree.Length; o++) {
         treeProtoTypes[o] = new TreePrototype();
         treeProtoTypes[o].prefab = tree[o];
     }

and then on the terrain:

 td.treePrototypes = treeProtoTypes;

tree is a array of gameobjects.

avatar image MrSoad · Nov 04, 2014 at 06:02 PM 0
Share

Sorry no idea, I've never tried to add to a terrain object at runtime...

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by KingMatthew · Nov 03, 2014 at 05:11 PM

In the prefab for your tree, put some kind of collider on it. Then in the terrain, check the box that enables tree colliders.

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 ExtremePowers · Nov 03, 2014 at 05:32 PM 0
Share

I have put a box collider on the tree prefab, and I am sure that it is applied. The Generate Tree Colliders checkbox is checked but I can run right through the trees.

avatar image KingMatthew · Nov 03, 2014 at 05:38 PM 0
Share

Try a capsule collider. $$anonymous$$aybe terrain trees only work with capsule colliders. Or, is your collider a trigger?

avatar image b1gry4n · Nov 03, 2014 at 05:48 PM 0
Share

Correct, trees only work with capsule colliders

avatar image ExtremePowers · Nov 03, 2014 at 05:54 PM 0
Share

It didn't work with a capsule collider either.

alt text

skærmbillede 2014-11-03 18.53.38.png (8.1 kB)
avatar image MrSoad · Nov 03, 2014 at 09:07 PM 0
Share

Create a new prefab, drag a tree with a collider onto it, now select this new tree prefab in your terrain editor, now paint one onto the scene and see if you can walk through that...?

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

29 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

Related Questions

Tree Colliders Not Working With Physics.CheckSphere / Capsule 4 Answers

Colliding with trees using mesh colliders 1 Answer

HingeJoint with no rotation? 0 Answers

ignorecollision return error 0 Answers

2D Sprites don't match the position of the 2DColliders 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