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 mxaddict · Oct 17, 2012 at 11:41 PM · water4water pro

How to detect if under Water (Pro Version with the waves)

Hi Guys,

I Currently Have this script that detects weather i'm under water by checking my cameras transform.position.y against the water level, but the issue is that with the PRO Version of Water, there are waves, that change the level, is their a way to detect in real time, what the level of the water is? so that even when my player/capsole is in same place, but the waves get higher than the camera, i can run my code for water effects?

Cheers.

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by PeterB · Nov 13, 2013 at 04:36 PM

There is no accessor in Water4 for the effective water surface height. There was one in Water3, but Water4 has none. On the whole, Unity haven't given Water4 much love in ages.

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 mxaddict · Oct 18, 2012 at 12:33 PM

Guys? No ideas?

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 Itinerant · Oct 18, 2012 at 03:51 PM

From my understanding, there's not actually any wave mesh that's changing shape. Pro water is a flat surface, waves and reflections are just animated textures on the surface. They render to look 3d, but when you get really close they're flat. You can test this yourself by placing a camera just above the surface of the water and watching it run.

Unless you have a different pro water than what I'm using, there are no waves to fight against :)

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 mxaddict · Oct 18, 2012 at 04:44 PM 0
Share

Hi Itinerant, I'm definately using a deffirent type of Pro water as i have dynamic mesh that has waves during run time, and when my player is half in the water, the waves will do over and under the camera.

avatar image Itinerant · Oct 18, 2012 at 04:49 PM 0
Share

Ah, did a bit more looking. Are you using the Water4Example that's included with the standard pro assets?

avatar image mxaddict · Oct 18, 2012 at 05:16 PM 0
Share

yeah, I used Water4 type of Pro Water.

avatar image Itinerant · Oct 18, 2012 at 06:25 PM 0
Share

Hmm, I can't help out with that, unfortunately :/ I imagine you'll have to dig into the code of the displacement scripts, as it doesn't appear that the mesh and any associated colliders are being deformed. That's beyond me, so I'll just wish you luck :)

avatar image mxaddict · Oct 18, 2012 at 06:37 PM 0
Share

yeah, i noticed that the actual tiles for the water weren't being deformed so i could not do a colider check, i'm still looking into the code. thanks anyway.

avatar image
0

Answer by moinchdog · Jan 05, 2013 at 11:47 PM

i got this working where i put the level the camera thinks its underwater about 0.5-1 above the actual water. If your going in slowly you might catch a glimpse of underwater effects above its really brief and hard to notice. Hope this helps

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

12 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

Related Questions

Unity 5 light reflection on the water surface 0 Answers

"Pro" Water turns an ugly gray in distance 0 Answers

Water is flat in Unity 5 2 Answers

Unity 5: Water4 4 Answers

Deep Water 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