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 Hamesh81 · Jun 08, 2015 at 02:07 AM · collisiondistancegameobjectslodsubmesh

How to handle collisions for LODs with different submeshes?

I have been trying to understand how collision based functionality can work with different LODs. I have a building prefab which at LOD0 has all of its windows as separate gameobjects, for collision reasons. For performance reasons the final LOD3 prefab is one mesh with the building and all of the windows combined into one.

I have simple projectile collision functionality which when colliding with any window triggers the window's destruction (switching the unbroken window for a broken one). If the projectile strikes the building instead of the window only a decal is created on the surface hit. If a user is standing within range of the LOD0 all is well. However if a user fires a projectile at a window from an LOD3 distance (windows and building combined into one), how can the projectile now trigger that specific window to break? It is my understanding that LODs change based on player distance, therefore how close the projectile is to the window will have no effect on the LOD.

This makes me think that it is only possible to achieve this with the windows and building all separated in every LOD. However at that rate, with one building having an average of 5 windows per floor, an average of 5 floors, that is 25 drawcalls for one building! There must be a better way to optimize this.

So my question is then; how to handle collisions for LODs while still having optimized assets?

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 Tanoshimi2000 · Mar 15, 2016 at 04:59 PM

This is just a theory, but since no one else has stepped up...

What if you used the location of the collision to determine if it's a window or a portion of wall. I mean, the collision event returns the point of impact. if your LOD means this is all one item, then you can take the coordinates of the impact, and the script would know locations of windows, and make it a broken window if on the window. Maybe check the building mesh for what's at that position, and if it's nothing, then you know it's a vacancy where a window sits.

As I said, this is theoretical. I could probably whip up some code to try it, but not if you've already solved or quit.

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

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

OnTriggerEnter only if two tags are found? 1 Answer

Restrict two objects from getting too close. 1 Answer

Avoiding objects falling on top of another 1 Answer

Combat begins when colliding with the enemy 1 Answer

Transparency When DistanceProblem 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