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 Brian 1 · Dec 28, 2009 at 11:15 PM · physicscolliderterraintree

Tree Colliders Not Working With Physics.CheckSphere / Capsule

I am having trouble getting the trees on my terrain that has "Create Tree Colliders" checked to work as functioning colliders. I am using Physics.CheckSphere now to determine if another collider is inside the position of an object I am trying to place only if there is nothing in the way. This works just fine for other objects that have colliders, but for some reason I can place the buildings right over any trees on my terrain. I know my Sphere is large enough because I have tried making the sphere cover the whole terrain, but Physics.CheckSphere still does not return true. I have tried a layermask for everything, just the terrain, just the default layer, and nothing, but none of them will get the trees to be in the way. All the buildings work just fine and can not be built on top of eachother, so I am not sure what the problem is. Also, I am using the trees that come in the resource package from the Unity website. Any help with this issue would be great, thanks!

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

4 Replies

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

Answer by jonas-echterhoff · Jan 26, 2010 at 04:04 PM

I just checked this, and I cannot replicate the behavior you are describing. CheckSphere does work with Tree Colliders. Are you sure the tree colliders are actually created? Does anything else collide with them? Tree colliders are only created when the prefab used as a tree prototype has a Capsule Collider component.

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 Brian 1 · Jan 28, 2010 at 12:09 AM 0
Share

Hmm... maybe the trees I am using do not have a Capsule Collider in the prefab. They are just the trees that come with Unity and the Tree pack in the Resources from the Unity site. Oh, and nothing else collides with the trees but the check on the terrain is checked.

avatar image jonas-echterhoff ♦♦ · Jan 28, 2010 at 09:23 AM 0
Share

Yup, that is correct. The palm tree which comes with standard assets will not collide as is. $$anonymous$$ake a new prefab with that tree, and add a capsule collider. Use that as a tree prototype and everything should work as expected.

avatar image
1

Answer by danielsig.du · Apr 06, 2010 at 05:57 PM

Hey I figured out what's wrong. You have to add a tree mesh to the stage, add a capsule collider component, then make it a new prefab. Click on your terrain and replace the trees with the new prefab :) voil!

Comment
Add comment · Show 1 · 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 BinaryCaveman · Aug 02, 2010 at 09:51 PM 0
Share

Thanks! I don't like walking through trees. :)

avatar image
0

Answer by danielsig.du · Apr 06, 2010 at 05:17 PM

this is happening to me also. I walk through trees :(

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
0

Answer by Mikey.du · Mar 29, 2011 at 09:40 AM

I add a capsule collider to the tree prefab then add it to the terrain and my unity crashes :(

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

No one has followed this question yet.

Related Questions

Colliding with trees using mesh colliders 1 Answer

Billboard system 1 Answer

Tree collider doesn't work 0 Answers

Create a custom Collider? 4 Answers

Trying to use colliders on trees to interact with player 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