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 Atrus_Madhatter · Jun 27, 2014 at 04:57 PM · 2dalgorithmphysics 2dsandbox

2D Sandbox physics problem

I have a problem with implementing sandbox like functionality to my game. The idea is that I have a huge object that is composed of multiple smaller blocks and when player cuts through the object the entire structure would technically be cut in half. So the smaller piece should fall off. Originaly I would have a gameObject with blocks as children of that object and they are stored in the array. Next when player modifies the object, the system would mark all the blocks that are adjacent to empty(air) block and using these edge blocks I would isolate disconnected parts. But that would take a lot of processing power. So next idea was to have 2D rigid bodies that are connected using joints, but huge number of those would impact performance as well. So here is my question: how do I tackle this? I'm more interested in the theory behind it rather than the code and examples themselves. Or should I stop using engine at all and start from scratch?

Here is the example of what I want to achieve: http://i.imgur.com/HJ4YTDi.gif

At first the entire thing moves as one entity but then, because no other blocks connect two pieces, the smaller part detaches and becomes another entitiy.

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 Xare · Jun 27, 2014 at 05:19 PM

If you want extremely precise cuts, you will have to generate sprites/meshes depending on the cut the player has made. Otherwise, you can try to recreate what fruit ninja has made and have one prefab for the whole object and another prefab for one half of the object. When player cuts your object, instantiate 2x half objects dependant on the position of the cut and make on of them fall down.

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 Atrus_Madhatter · Jun 27, 2014 at 05:35 PM 0
Share

Sorry I might not have been clear but here is the example of what I want to achieve: http://i.imgur.com/HJ4YTDi.gif At first the entire thing moves as one entity but then, because no other blocks connect two pieces, piece of it detaches as its own entitiy. I'll edit my post with this information.

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

game hags with several Polygon Colliders on the scene 0 Answers

store unique variable on first OnTriggerEnter 1 Answer

How to edit the following code to make world chunks disappear when past render distance? 0 Answers

Assets/Scripts/PlayerController.cs(32,49): error CS0126: An object of a type convertible to `float' is required for the return statement 1 Answer

Why does my 2d player stick to the floor when he lands? 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