Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 manno · Jun 29, 2011 at 04:28 PM · terraincolliderstrees

Terrain tree colliders as triggers

What's the best way to create colliders for trees that act as triggers? I know how to make collision colliders for trees, but not trigger ones. We have a lot of trees in our game and we need to make them all triggers, any suggestions?

Comment
Add comment · Show 1
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 manno · Sep 30, 2011 at 06:31 PM 0
Share

This tree colliders thing is extremely frustrating is there no workaround that will work? Are there plans to fix this in the future?

2 Replies

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

Answer by Chris D · Jun 29, 2011 at 04:32 PM

Well, to set a collider as a trigger, there's a property, detailed here, called isTrigger. Just set it to true in script or you can check the box in the inspector (under the collider's entry).

This will cause other colliders to pass through your trees with no physical collision. If you're just looking for a way to see when a tree is collided with while maintaining it's solidity, just use the appropriate version of onCollision (first three results).

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 manno · Jun 29, 2011 at 04:46 PM 0
Share

Thanks fo the response ChrisD, unfortunately that doesn't seem to be the problem. The crux of it seems to be to create a "terrain tree" that can be painted onto the terrain you need to:

  1. place your tree model into the scene

  2. assign a capsule collider to that tree

  3. adjust the collider to fit the tree as you want it to fit

  4. create a prefab from your tree+collider object

  5. in the terrain editor -> tree painting menu add a tree and use your tree+collider prefab as the tree model.

from what I can gather when you turn a prefab with a trigger collider into a terrain tree the trigger collider no longer works.

avatar image Chris D · Jun 29, 2011 at 05:16 PM 0
Share

That...really is strange. I suppose you could always loop through a list of your trees afterwards and set isTrigger to true, but that seems like a hacky work-around...

avatar image manno · Jun 29, 2011 at 05:54 PM 0
Share

That's what I thought too. So wait, have you had any success with using terrain trees with trigger colliders? Do you have any suggestions on how I could get them to work.

Here's a run-down of what I'm trying to accomplish with terrain trees as a trigger:

Prefabs/Assets:

  1. I have a particle effect prefab that has a leaf texture looks like falling leaves.

  2. Tree with collider set to trigger.

  3. player race car.

    Interactive Actions:

  4. WHEN a race car collides with a tree THEN A. Slow down car (but do not stop it!) B. spawn leaf particle prefab on tree.

Currently I'm adding sphere/capsule colliders by hand to all the trees in a scene to trigger this action, but if I'm going to make multiple levels with any kind of efficiency I'm going to need another way.

Again I can get the terrain tree collision colliders to work fine... but that makes trees that completely stop the player. I just want trees to slow down the player.

Thanks again for you assistance!

avatar image Chris D · Jun 29, 2011 at 06:07 PM 0
Share

In your terrain, is the Generate Tree Colliders box checked? If so, it's probably over-writing your custom collider/trigger.

avatar image manno · Jun 29, 2011 at 06:10 PM 0
Share

Nope it's unchecked :(

Show more comments
avatar image
0

Answer by manno · Sep 30, 2011 at 06:33 PM

This tree colliders thing is extremely frustrating is there no workaround that will work? Are there plans to fix this in the future?

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 manno · Sep 30, 2011 at 06:50 PM 0
Share

If I set the terrain collider to a separate layer from the player collider the player collider still is impacted by the tree colliders! Why wont this work? When will it get fixed?

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

Scripts on Terrain Trees 2 Answers

How can I have mass amount of tress without performance loss? 2 Answers

Removing colliders from terrain trees 2 Answers

How to disableTerrain Collider but keep the Tree Colliders? 1 Answer

Disable collider on only 1 tree type not all? 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