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 DenisGLabrecque · Sep 02, 2018 at 12:40 PM · physicsrigidbodyparent-childtorquefixedjoint

Missiles attached with FixedJoint cause too much torque for airplane physics

I have an airplane controlled by the heavily modified AeroplaneController.cs physics. This works very well, and it has been tuned to turn relatively sharply.

However, I want it to carry missiles that are also physics-based. So I created a missile prefab and attached a couple to the airplane in code, like so:

      // Add a missile to each launch position
      for(int i = 0; i < m_MissileLaunchPositions.Length; i++)
      {
         GameObject missile = m_AAMissilePrefab;

         // Assign the fixed joint to the airplane
         missile.GetComponent<FixedJoint>().connectedBody = m_Rigidbody;

         // Add the missile to the rack
         Instantiate(m_AAMissilePrefab, m_MissileLaunchPositions[i]);
      }

This works nicely. However, even if the mass of each missile is only 0.0001, (the airplane's being 0.54), and drag/angular drag are reduced to zero, the airplane's maneuverability is hampered dramatically.

Creating a test case which launches the missiles:

 public void Launch()
 {
    // Detach the missile from the airplane
    Destroy(m_Joint);
 
    // Play the escaping air sound
    m_AudioSource.Play();
 }

Proves that maneuverability is restored once the missiles are detached.

I'd like to use a FixedJoint instead of manually adding/subtracting from my airplane's Rigidbody weight when missiles are shot, because this adds weight to one side or the other of the airplane, instead of to the center of mass of the airplane's Rigidbody. But my issue here is that the torque caused by the missiles is by far exaggerated compared to their weight.

Photo of the missile prefab inspector settings

Is there a known solution around this?

unity-fixedjoint.jpg (165.1 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
1

Answer by JVene · Sep 03, 2018 at 07:01 PM

Using PhysX outside of Unity, and within Unity (it's the engine under the hood here) demonstrates rather clearly there is no great solution here.


Frankly, joints are not that realistic for a wide range of expectations. They do what they do, and they have all sorts of 'issues' relative to expectations. and that applies to everything from fixed joints to configurable joints. There are a set of 'articulated joints' recently added to PhysX, but they're not exposed in Unity at this time, and may offer some useful difference in the future, but I don't know how applicable they will be to your observation and inquiry.


This isn't really the all that bad a thing as it seems. We generally make assumptions about the expected behavior of concepts, like joint attachments, which aren't actually provided by the physics engine, because we tend to think these systems ought to perform according to our expectation of a real systems, but they're not simulations of reality. They mechanisms that facility the creation of a kind of 'puppet show'. This means we are generally reduced to using what's available to 'fake' the kind of results we expect. This isn't so much a failure of PhysX as it is the sort of compromises required for real time physics calculations.


That said, you might find some relief by making the plane a bit close to a real mass than you have. The mass unit in Unity is 1 Kg, so your entire plane is being simulated as if it were only about half a Kg, which may do better toward the range of 100 Kg or more. This will impact everything you already have working, but as an experiment it may lend some useful information.


If that doesn't work, you'll need to explore Rigidbody's centerOfMass property, relative to your concerns about eccentric mass distribution. There may not be a better solution. In my own efforts with various vehicles and objects, I've not really found one.

Comment
Add comment · Show 3 · 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 DenisGLabrecque · Sep 03, 2018 at 09:21 PM 1
Share

Because my game imitates RC-controlled aircraft, I don't want a realistic aircraft mass, but I will check what happens. This could also have to do with the reduced size of the object (though that really doesn't make sense, because a small distance from a CG produces little pull; however, we get into since the airplane is smaller, the forces applied might differ...)

I like your idea about the center of mass, in the case where getting more detailed with the weight of things is more than just chucking in or removing a few grams.

avatar image JVene DenisGLabrecque · Sep 03, 2018 at 09:26 PM 0
Share

I'm giggling over the idea of an RC controlled aircraft that actually shoots missiles.

avatar image DenisGLabrecque JVene · Sep 03, 2018 at 09:35 PM 0
Share

Yes, in my imagination they're plastic sound-guided compressed air rockets ;)

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

173 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 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

Spinning a sphere in place causes unwanted velocity. 1 Answer

Aligning 2 Quaternions Using Torque 1 Answer

Is there any way to keep increasing an object's angular velocity? 1 Answer

Returning a rigidbody back to its original x and z rotations through physics forces. 2 Answers

Physic Torque Hinge joint problem 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