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
3
Question by Kiloblargh · Mar 31, 2010 at 05:49 PM · physicswaterconfigurablejointswim

How can I fake buoyancy (floating) with a configurable joint (or with a script)?

I already checked out a "real" buoyancy script, and determined I don't want that. Large, flat objects are likely to fly up in the air and/or spaz out, and when it does work, they are too easily overturned. So I want to fake it.

But I can't configure the configurable joint to do what I want it to- act like a raft. You jump on it, it sinks a little then returns to a lower resting point- jump off, it bounces back up and settles to its original position. This by itself shouldn't be hard to do, but I also want it to tilt slightly toward the edge you're standing on if you are standing off center.

So I want its translation tightly limited, in a springy way, along the Y axis; and its rotation even more tightly limited, in the same springy way, on the other two axes.

Or putting it another way- it should be able to move freely in the xz plane and rotate freely around its y axis but be otherwise spring-constrained.

I don't know why but I can't configure a configurable joint to get this behavior. Or any behavior I'm trying to get from it for that matter.

I'm dropping a rigidbody cube on it to test it and my raft always just sinks, no matter how I have the joint set up. And it rotates as it is sinking, even if I set the x and z rotation to "locked." I just don't get it.

Comment
Add comment · Show 1
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 Kiloblargh · Mar 31, 2010 at 08:31 PM 0
Share

I figured out my main mistake, which was setting the axis to Y. Which is what I think should be right, but if I set it to X the vertical floating works, and if I set it to Y, it doesn't.

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Kiloblargh · Mar 31, 2010 at 08:45 PM

Figured it out, so I need to answer my own question:

Axis X, secondary axis 0 Xmotion: Free Ymotion: Limited Zmotion: Free

Xmotion: Limited Xmotion: Free Xmotion: Limited

Linear limit 0, 0.2, 3, 1

High Angular XLimit: 0, 0.4, 3000, 0.2,

Angular Z limit: Same as above

Rotation Drive Mode: Slerp

Slerp drive mode: position

Spring: 8 Damper 0.8

And it's working! Main issue is that the spring on the rotation has to be so much higher than the spring on the translation, and the axis confusion was what was keeping the joint from working at all.

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

Answer by duck · Mar 31, 2010 at 07:27 PM

Have you seen this answer?

It describes a method which results in stable floating raft-like platforms. It doesn't use a configurable joint though. I don't think a configurable joint is really a good fit for this problem.

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

Answer by wishing · Aug 24, 2010 at 02:39 AM

Hi, im sorry but i dont really understand your answer. can you answer it in a more scripting way? im really bad at scripting.

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 Waz · Aug 24, 2010 at 03:39 AM 0
Share

I think you mean to Comment, not "Answer". And the above is not scripting - it's saying what values to set on the ConfigurableJoint - i.e. you don't have to script anything.

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

No one has followed this question yet.

Related Questions

Allowing player to swim or dive in water? 6 Answers

Calling OnJointBreak on Connected body 1 Answer

Water physics in solid object 2 Answers

ConfigurableJoint Target Position/Rotation Issues? 1 Answer

Is there a way to create water like behavior. 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