Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Water Waves 2D - a 2D water effect

Discussion in 'Assets and Asset Store' started by Andrii, Nov 3, 2019.

  1. Andrii

    Andrii

    Joined:
    Sep 23, 2013
    Posts:
    136
    Water Waves 2D is the effect for simulating 2D water surfaces with configurable properties, such as colors, sounds and properties of the waves.



    Features
    • Modify how thick is your simulated sluid by seting the speed of oscilations, how fast they spread and how fast they decay.
    • Set frequency, size and force of random ripples to simulate rain or uncalm water surface.
    • Water can be a rectangle with a top surface or a circular surface.
    • Respects project's Time Scale setting.
    • Supports sprite sorting layers.
    How does it work?
    It creates a 2D mesh with a trigger collider and buoyancy effector and keeps and array of points. On trigger enter and exit it applies forces to the points, calculates their new positions based on spring equations and updates vertex positions of the mesh.

    What it cannot do?
    Right now it doesn't support texturing or any kind. It only uses the default sprite shader and doesn't not have shaders to create any effects. It also does not generate any particles yet. These features can be added in the future, especially if they'll be requested.

    Get it here!
     
    Last edited: Nov 11, 2019
  2. aryabhay

    aryabhay

    Joined:
    Dec 27, 2019
    Posts:
    1
    Hey. I bought the asset but it is not showing in the list when i try to create a 2D object. Please help.
     
  3. Andrii

    Andrii

    Joined:
    Sep 23, 2013
    Posts:
    136
    From the screenshot you emailed me I saw that you're using Unity 2018 and this asset was only supposed to work in 2019 and higher (there was a note in description on the store page) but now I've updated it to support 2018 too (turned out to be pretty simple). This should fix it for you.
    Thanks for choosing my asset and feel free to contact me if you'll have any other feedback.
     
  4. PierceDev

    PierceDev

    Joined:
    Feb 2, 2018
    Posts:
    1
    Is there a possibility to form a 2d Tsunami using this asset? or is there anything you recommend i have a look at
     
  5. Andrii

    Andrii

    Joined:
    Sep 23, 2013
    Posts:
    136
    Not sure what exactly you want to acieve but this asset doesn't do much more than shown in the video. If your intention is to simulate a wave, you can use the WaterWaves2D.Impact() method. It takes three arguments: position, the size of the object that is causing an impact and force of impact. The direction of the force decides if the impact causes water up or down.

    Code (CSharp):
    1. void Impact(Vector2 position,Vector2 size,Vector2 force){
    You can call this method to manually create a wave without colliders entering or exitting it.
     
  6. wallmasterr

    wallmasterr

    Joined:
    Dec 30, 2012
    Posts:
    6
    This seems to work great, couple questions though.
    Is there a built in option to add a texture to the water kinda like you have in this post ?
    https://twitter.com/ax23w4/status/1150059345432010752
    I want to add some texture to the water as it looks a bit boring in large areas.

    Also im getting an error when untiking Enable audio.
    im using unity 2019.4.18f1
    "MissingReferenceException: The object of type 'AudioSource' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object."

    Thanks
     
  7. Andrii

    Andrii

    Joined:
    Sep 23, 2013
    Posts:
    136
    I'm sorry but this is something that I was working on by never finieshed. I hope to add an option for the texture in the future but I can't promice that I'll do it anytime soon. Too busy with my main job at the moment.

    I'll take a lok at this and will add fix asap.
     
  8. Hiago_flow

    Hiago_flow

    Joined:
    Sep 18, 2020
    Posts:
    1
    Oi! você poderia me ajudar por favor?

    Acrescento os arquivos de áudio, água fazendo respingos, mas o som está muito alto, gostaria de abaixar, mas não consigo encontrar a opção para fazê-lo. Como posso controlar, diminuir ou aumentar o volume dos arquivos de som?