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 POLYGAMe · Jun 14, 2012 at 09:41 PM · collisionoptimizationtriggersoptimisationterrains

A question about terrain collision

Hi again, another noob question from yours truly...

I am making a "Mode7" styled racing game... for the off-track area and boundary collision, I am using terrains (invisible to the player). The problem I have, is for the boundary terrain collision, if I set it to a trigger (to activate damage/play crash sound etc) the car drives through it... I know this is how triggers work, as it detects when one object intersects with another, so the workaround I have done is used two identical terrains, one as a trigger, the other to act as a solid object, to stop the car. Is this the way to go? Doubling up on terrains seems a bit overkill for me... I don't have any performance issues, the game runs perfectly on even older hardware (although I have yet to try out on iOS), but I would like to know if there is a better way, for optimisation's sake :)

Cheers!

Comment
Add comment · Show 13
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 whydoidoit · Jun 14, 2012 at 09:53 PM 0
Share

You weren't getting OnCollisionEnter when it wasnt a trigger?

avatar image POLYGAMe · Jun 14, 2012 at 11:34 PM 0
Share

No... is that odd? I thought that was normal...

avatar image whydoidoit · Jun 14, 2012 at 11:37 PM 0
Share

You should get an OnCollisionEnter I thought - hey I'm no expert with terrains and collision, but I can't see why you wouldn't.

avatar image whydoidoit · Jun 15, 2012 at 12:19 AM 1
Share

Well you won't get an OnTriggerEnter if it isn't a trigger - but you will get an OnCollisionEnter (which takes a Collision as a parameter not a Collider).

avatar image whydoidoit · Jun 15, 2012 at 12:42 AM 1
Share

Posted it as an answer so future generations won't need to read a lot of comments...

Show more comments

1 Reply

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

Answer by whydoidoit · Jun 15, 2012 at 12:41 AM

Use a single terrain, not a trigger and check OnCollisionEnter rather than OnTriggerEnter.

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 POLYGAMe · Jun 15, 2012 at 12:53 AM 0
Share

Works like a charm. Can't believe I was doing that! LOL. Noob...

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Optimising Sprites for 2D Unity games 1 Answer

Simple Animation showing as ~6.3 in Xcode console profiler 0 Answers

Broadphase CD in Unity - pile of rigid bodies unsolved 0 Answers

Character Controller slows game heavily on Android 0 Answers

How do I make a car in my driving scene trigger the trotting of a deer (on collision with a box collider around another object) and then make the deer die when my car collides with the deer?, 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