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
1
Question by Jeston · Jul 22, 2011 at 07:34 PM · physicshoverballoon

Hot air balloon carrying a crate ?

Suggestions on modeling the physics objects for a hot air balloon carrying a crate ?

I am not concerned about the string. Idea being is if the character hits the crate the balloon tilts and floats slightly astray, but if they hit the balloon it pops and the crate falls...

I have tried all kinds of parent -> child relationships with varying types of spring joints etc....

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 Jason B · Jul 22, 2011 at 08:05 PM 1
Share

You say you've tried all kinds of things. What was wrong with the things you tried? What exactly have you tried? Overall, making a balloon carrying a crate seems quite simple, so I'm just curious to see why it hasn't worked out for you.

avatar image Herman-Tulleken · Jul 22, 2011 at 10:20 PM 0
Share

Yeah, it would be really cool if you could list the things you have tried and why they did not work. I once implemented a hovercraft that took millions of tests before it worked; and I am interested to compare alternatives. (I rolled out my own spring-damper system...that was before I really knew about joints, so I don't offer it as a possible answer... but you could get the gist of it from these:

http://answers.unity3d.com/questions/26554/how-do-i-calculate-a-corrective-torque-to-remove-r.html

http://answers.unity3d.com/questions/27418/follow-a-curve-using-physics-or-transform-manipula.html

A balloon should be slightly easier, since you don't have to worry about the direction in which it is facing.

avatar image Jeston · Jul 25, 2011 at 07:41 PM 0
Share

the biggest issue is that I am probably looking for a stylistic change. The issue i have is that mainly the crate gets all crazy, as in crate moves one way, balloon moves other.

I have tried them both being rigidbodies, a combination of joints with limit forces on them.

The look and feel I was ai$$anonymous$$g for is that when the character hits the crate on the side the balloon gets pulled along and drifts to a stop in a pendulum like motion.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Jeston · Jul 25, 2011 at 09:05 PM

So in the end my physics methods were correct, there is a bug with recursively turning off nodes that blasts my physics objects for some reason.

The physics model I ended up using: Crate is a rigidbody with a hinge joint connected to the balloon. The balloon has same mass but a constant up force and the two objects are sibling objects. The balloon has an increased drag and angular drag and they both use gravity.

Now here is the unity bug: If they are both childed to GameObject A, and I do A.setActiveRecursive(false), then turn it back on later with A.setActiveRecursive(true)...

Then the physics gets completely blasted. This is a hard deal for me to figure out as I have tons of objects on different level nodes that get recursively shut down and turned back on.

When I say physics gets blasted I refer to things like the balloon appears 1000 units to the right, and the crate is at world 0 jiggling back and forth, and other symptoms. The references on the joint are still correct, but they seem to be ignored. However, if I don't turn them on or off, it works fine. Ugh...

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 aldonaletto · Jul 26, 2011 at 12:25 AM 0
Share

It's really a physics bug: if you have a baloon joint to the crate, when setting active the baloon appears during one frame and in the next it goes to God-knows-where. It seems Unity assign the negative of the jointed object coordinates to the baloon. I'll report this bug to Unity.

avatar image
0

Answer by aldonaletto · Jul 22, 2011 at 08:49 PM

Provided you have some joint between both, you can simulate a baloon physics with the following:

 var massCrate: float = 1; // adjust for the crate mass, if needed
 
 function FixedUpdate(){
   rigidbody.AddForce(-Physics.gravity * (rigidbody.mass+massCrate));
 }

This will keep the baloon and the crate at a stable condition. If you kill the crate, the force will become too excessive and the baloon will fly. If you kill the baloon, the crate will fall since nothing more sustains it.
You may have to tweak the baloon mass to make it go up reasonably slowly when the crate is killed - the most massive, the slower it will go up.

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 aldonaletto · Jul 25, 2011 at 09:06 PM 1
Share

If you use a fixed joint between the crate and the baloon, the behaviour is what you're expecting: when the crate is touched, both start to move with a little pendular movement. $$anonymous$$aybe adjusting drag you can make them stop after a few oscillations.

avatar image solci · Nov 16, 2018 at 10:01 PM 0
Share

Hello, this is an old question, i'm hoping you gonna read :)

Using your techinque, how can i include drag into the formula? Because it works with zero drag on all objects, but i need a little drag because some object will be blown by the wind. If i add drag to one of them they all go down.

avatar image aldonaletto solci · Nov 27, 2018 at 04:26 AM 0
Share

Rigidbody.drag doesn't do what you want: it just emulates friction, slowing down rigidbodies when they are moving. If you want to drag them with the wind, you must apply a force in the wind direction - and set Rigidbody.drag just to limit the velocity: the bigger the drag, the lower will be the "ter$$anonymous$$al velocity" (the velocity where the applied force equals friction).

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

6 People are following this question.

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

Related Questions

help me blow my balloon.... 1 Answer

Balloon-like joint system? 1 Answer

Center of mass (or center of pull) 2 Answers

Hover spring in local gravity 0 Answers

2D 360 degress platformer example needed 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