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 leonardo_try · Jun 23, 2011 at 09:55 PM · rigidbodyjointfixedconnectedbody

Multiple connected body on fixed joint

how can i use multiple body connections fixed joint on a object? So an object can be fixed by the objects that are in his side, and not fall down with the rigidbody, but if all the objects around you be destroyed, he'll fall down. is this possible?

thanks.

Comment
Add comment · Show 3
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 Chris D · Jun 23, 2011 at 10:29 PM 0
Share

Does this have to be done with physics or would you accept a code/faking it answer?

avatar image leonardo_try · Jun 23, 2011 at 10:43 PM 0
Share

i thought in use phisics, but i can use faking aswell

avatar image Chris D · Jun 23, 2011 at 10:58 PM 0
Share

Can you expand a bit on how you have things set up? Like, do you want the object (that's going to fall) fall through a platform of some sort? Do you want it to play a fall animation? What exactly is holding it up?

Asking 'is it possible' will almost always yield a 'yes', the trick is in the 'how'.

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by Bunny83 · Jun 24, 2011 at 12:56 AM

Well, it really depends on what exactly you want to achieve. You can of course use multiple fixed-joints to hold the object at the position but in your case it would be simpler and less loading for the physics system to simulate the effect. Joints are useful if they should break automatically when they exceed their maximum force. Your example sounds like a pure logical problem ;)

From your description i guess you have some objects around another object that is going to fall when all of the surrounding objects are destroyed. I don't care about how you destroy the objects. I just show how you can simulate that the objects "hold" the center object.

I've checked all of your other questions to figure out what language you are using. I didn't found anything so i use C#

 // FallWhenAllObjectsDestroyed.cs
 using UnityEngine;
 using UnityEditor;

 [RequireComponent (typeof (Rigidbody))]
 class FallWhenAllObjectsDestroyed : MonoBehaviour
 {
     public GameObject[] Constraints;
     void Start()
     {
         rigidbody.isKinematic = true; // disable physics on this object
     }
 
     void Update()
     {
         bool allDestroyed = true;
         foreach (GameObject GO in Constraints)
         {
             if (GO != null)
             {
                 allDestroyed = false;
                 break; // If there's still an object alive we're not done yet
             }
         }
         if (allDestroyed)
         {
             rigidbody.isKinematic = false; // re-enable the physics --> object will fall
             Destroy(this); // remove this script because it's no longer useful
         }
     }
 }

Just attach that script to the center object and resize the "Constraints" array to your needs. Assign all objects that "holds" the center object to the array and you're done. When all objects are destroyed the object will start falling.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Joint connected body not working 1 Answer

Problem trying to set "connected body" of Fixed Joint via script upon build 2 Answers

Rigidbody Sliding UP Incline 0 Answers

Violent shaking when using position drive in Configurable Joints 1 Answer

Configurable Joint just falls apart? 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