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 SeaLeviathan · Apr 06, 2018 at 03:49 AM · gameobjectlistalgorithmsearchfunction call

Best way to check for supports in building system?

My problem sounds simple: How do I tell my game that these bricks are no longer supported? Picture for reference on my problem: alt text

Things I have for Data:

  1. Each brick has a list of supports, being all the bricks it is connected to.

  2. Easy access to any of the bricks using referential scripting

  3. A system to mark whether or not a brick is on the edge of a shape

  4. Markings as to whether or not a brick has been destroyed (Shown in green outline, I turn off mesh and collider.)

  5. The ability to reconnect the bricks when and if needed (It's probably needed.)

The problems I face and the things I have tried:

  1. Maybe I can try a sort of flood fill? That way I can check if a full circle is completed with the "Destroyed" bricks and then regroup them as another object! Catch: The possibility of congestion of "Destroyed" bricks accidentally making the wrong circle (i.e. a lot of big holes are making a cut out but the fill will accidentally go in a quick loop back to the origin, "Completing" a circle)

  2. Well, how about I give each brick a list of what exactly is supporting it? There was a post about the Fortnite building system, it was briskly ignored, and I do need something like that. Each brick has a list of who it is supporting and who is supporting it! easy! Catch: Really not easy. How do you know what's supporting what in this dynamic mess? For example, the middle brick of a large wall could be one of the largest supporting pieces, holding about as many as the base bricks do. Really, this could get WAY too convoluted way too fast.

ONE last thing, I haven't tried but may need help with:
Every time one of these bricks gets "Destroyed" I will make a move like a race car. First, go up. Then down. left. right. forward. back. You get the idea? Its a problem if we hit a solid wall, and were good to go if we are traveling on the "Destroyed" road. Catch: Maybe it only works for cutouts? I could do a secondary check for things as shown on the picture above (Being an edge to edge cut rather than a cut-out). Second: Is this really the right approach? how breakable is this?

All in all, I feel like I'm SO CLOSE! Been working at it for a week straight about, keep getting ideas then finding problems :/. A fresh eye to the situation would be stellar!

failedsupport.png (237.0 kB)
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
2
Best Answer

Answer by Zaeran · Apr 06, 2018 at 01:18 PM

You can use a simple pathfinding algorithm from the ground, starting with the first brick touching the ground plane, to build up a list of connected bricks. Any brick not on the list have no bricks supporting them, as there isn't any connection to the ground.

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 SeaLeviathan · Apr 06, 2018 at 09:05 PM 0
Share

Omg that is so simple!! lol I did not even think of this thank you so much, it makes a lot of sense now that I think of it. Leave it to me to make such an easy problem a complex mess!

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

115 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Brute Force Search Algorithm 0 Answers

Finding the first gameobject in a List that meets a condition 2 Answers

A node in a childnode? 1 Answer

How i generate Gameobjects list? 0 Answers

GameObjects creation within boundry 3 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