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
2
Question by $$anonymous$$ · Dec 18, 2014 at 10:57 PM · collisiontreesclipping

How can I get two capsule colliders on the same tree prefab?

I am trying to make my trees so they cannot be clipped through at all, but I still want the player to "touch" the tree. I figured out how to make the player unable to move through the trunk of the tree, but I cannot make it so they collide with the branches. Now, if I make it so they cannot collide with the branches first, the player is able to move through the trunk without a problem. The tree has the colliders for both, but only the one I added first actually works. Is there a way to make it so both works or even better yet, a totally different and more realistic way of going about this?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by SkaredCreations · Dec 18, 2014 at 10:58 PM

Create new objects with collider within the tree hierarchy, so you'll have as many colliders as you like. Or eventually you could use Mesh Collider attached to objects that have a mesh renderer.

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 $$anonymous$$ · Dec 18, 2014 at 11:01 PM 0
Share

So I guess a follow up with that: How can I make those objects invisible?

avatar image hero_kenshin · Dec 18, 2014 at 11:08 PM 0
Share

If it's an empty gameobject with just a collider it will be invisible

avatar image $$anonymous$$ · Dec 18, 2014 at 11:14 PM 0
Share

I did not end up working

avatar image Bunny83 · Dec 19, 2014 at 03:15 AM 0
Share

@OneWithTheCore: You either have to:

  • Add an empty gameobject as child and manually add a capsule collider to that empty gameobject

  • Add a capsule object from the gameobject menu and remove the $$anonymous$$eshRenderer and $$anonymous$$eshFilter as those will render a capsule mesh object which you don't want.

avatar image MrSoad · Dec 19, 2014 at 03:28 AM 0
Share

Hi @Bunny83 I redid a tree prefab in this way and applied it to the terrain object. I had the same result as before, the second collider did not register...

Can you tell me where I'm going wrong on this, thanks :)

avatar image
0

Answer by MrSoad · Dec 18, 2014 at 11:10 PM

I've just done a test in a scene of mine and what you say in your post seems to be true. If I create a tree prefab with two colliders and place this on my scene then they both work as expected. If I then add this prefab to the terrain trees and paint one or more onto my terrain only one of the two colliders on each tree painted works(the first one added). Maybe this is something deliberate about how the terrain system works, I know that the mesh objects that are used within it have to be one whole mesh or you get errors there too...

Edit : Note that you did not mention terrains in your post, so it is my best guess that this is the problem that you are talking about. If it were not for this then what @SkaredCreations says is absolutely right.

Edit 2 : I would think that using Mesh Colliders on trees is probably not a great idea.

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 $$anonymous$$ · Dec 19, 2014 at 03:12 AM 0
Share

I am sorry that I was not clear. They are trees for the terrain. What am I supposed to do since they are part of the terrain?

avatar image Bunny83 · Dec 19, 2014 at 03:21 AM 0
Share

@OneWithTheCore: Hmm i never really used the terrain engine so it might be possible that you can't add more than one collider for a tree prefab.

This might be helpful. Since the trees are usually fix in place, generating an additional collider prefab for each tree instance should be quite simple.

avatar image MrSoad · Dec 19, 2014 at 03:36 AM 1
Share

Just tried out a convex mesh collider, the terrain placed trees ignore it completely, can walk right through it... :(

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

How do I prevent my 2D Sprite from clipping into my 3D Environment 0 Answers

Collide with trees? 1 Answer

Tree billboards clipping into terrain 1 Answer

MouseOrbitImproved camera distance seemingly inverted 1 Answer

Player jumping from wall sometimes jump even when not collided with other wall 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