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 darkhog · Oct 06, 2013 at 03:33 AM · waterimplementationbuoyancy

How to implement water buoyancy

How do I do that? I'll have some water in second level of my game and I don't want player just drown.

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 tanoshimi · Oct 06, 2013 at 06:14 AM

Buoyancy depends on the relative density of an object to the fluid in which it is floating, together with the degree by which it is covered by the fluid. You'll also probably want to consider drag, which depends on the viscosity of the fluid. If you're using inbuilt Physics, it should be relatively easy to implement these additional forces when the player object is in contact with water, and let the physics engine resolve them automatically.

Comment
Add comment · Show 5 · 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 Jamora · Oct 06, 2013 at 10:24 AM 0
Share

The easiest way you can implement buoyancy is by giving the buoyant object an appropriate ConstantForce

avatar image tanoshimi · Oct 06, 2013 at 01:43 PM 0
Share

But buoyancy is not a constant force - it's equal to the weight of fluid displaced by the object. And that depends on the density of the fluid and the volume displaced.

avatar image Jamora · Oct 06, 2013 at 01:57 PM 0
Share

True. I'm working under the assumption that he's not going for realistic physics, but ease of implementation.

Even if he was going for full realistic physics, a ConstantForce only means a force is constantly applied to the rigidbody each physics update, the amount of force could be changed whenever.

avatar image tanoshimi · Oct 06, 2013 at 04:07 PM 0
Share

And, as we've had no further input from the OP, we're both pretty much guessing what is required anyway! ;)

avatar image darkhog · Oct 06, 2013 at 08:43 PM 0
Share

I want my player being able to swim like in $$anonymous$$inecraft (though game has nothing to do with $$anonymous$$C)

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

17 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

Related Questions

Making an object float in water 2 Answers

3d Water Simulator 1 Answer

How to Script Buoyancy with a Water Shader 2 Answers

Having trouble with player boat movement with buoyancy pack 0 Answers

Bouyancy Effector Issues 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