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
1
Question by pretender · Nov 19, 2010 at 04:26 PM · collidersmultiple

multiple colliders

i tried to add multiple colliders to my object that have highlight script attached to it so it reacts to mouseover. first i thought it should be enough to add two spheres at the end and one box collider in the middle instead using expensive mesh collider. but i was surprised when i got the error that i cannot add the same type of the collider to one object. then i found some topics in the forum and tried to add collider to the empty gameobject as child. but then mouse over function would not work.... so how to deal with this problem? is it possible to have mouseover script and multiple colliders in the same time.

is the mesh collider expensive after all? if i use low poly count can it be fast as box and sphere colliders? at least not to cause fps to drop significantly?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by The_r0nin · Nov 19, 2010 at 04:38 PM

When you say that you added an empty gameobject to your original object and attached a collider component to it, where was your "highlight" script (on the original object or on the new object)?

If you have an object you want to behave in a certain way during mouseover, put the script with the effect function on the object. Then create your collider objects as children and put the mouseover script on them. Then when the individual objects are "moused-over" have the mouseover script call the function on the parent object to create the effect.

Seriously, though, unless you are well along in your game and have already hit a performance roadblock, why not use a mesh collider? Optimization is best left for after you have a working game with a problem. Why spend tons of time working around a "problem" that might never actually be one? JMHO...

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 pretender · Nov 19, 2010 at 09:59 PM 0
Share

i have something that is usable and now trying to optimize things you are right. i have the biggest impact at fps during game because of the mesh colliders. i have this capsule that is attached to the camera which when collides with other objects make them fade out, so i need to use as precise collider as possible. ontriggerenter start the fading. so maybe i am missing something, maybe i could optimize the script that is doing the fading...

avatar image The_r0nin · Nov 19, 2010 at 11:17 PM 0
Share

Well, try adding 3 empty child objects with the colliders and pass the collisions up to the parent. That might work for you.

Also, are you check for the collision every frame? If you use a toggle for mouseover/mouseleave, you could probably only check for a change every few frames and no one would notice...

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

Retrieving Multiple RaycastHit Colliders 1 Answer

how to add colliders to several objects? 1 Answer

Turn off all Colliders from Scene 1 Answer

Multiple Colliders Issue 3 Answers

physics.OverlapSphere colliders 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