Search Unity

2D Game - Water Effects

Discussion in '2D' started by dilmerval, Jan 6, 2014.

  1. dilmerval

    dilmerval

    Joined:
    Jun 15, 2013
    Posts:
    232
    Guys,

    I'm honestly new to Unity well about a year and had become very profficient in their tools, however by not having past experience I often think if I'm doing things the right way. I'm working in a 2D Water effect for my new game and wanted to share what I've done. I've used multiple components to achieve the water effect:

    1- A Sprite that controls the water color, used a Particles/VetexLit Blended Material.
    2- Particle System to simulate splashes from water on top.
    3- Unity Water Pro image effects - Water Base script/Specular Lighting script / Gerstner Displace script.
    4- Sound effects for water, when player jumps in it basically has a water splash.
    5- Gravity changes once player is in the water, -> Physics.gravity = new Vector3(0, 10.0f, 0);

    $WaterGameObjects.png

    $Water2D.png

    $Water3D.png

    Let me know your thoughts or recommendations, I found this works pretty well but I like to learn what other people have done :)
     
  2. unitylover

    unitylover

    Joined:
    Jul 6, 2013
    Posts:
    346
    I'm fairly certain you are the man and that this is a really good way to accomplish 2D water. Thank-you for posting your experienced with us.
     
  3. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    I'd love to see a video of the end result ;)
     
  4. dilmerval

    dilmerval

    Joined:
    Jun 15, 2013
    Posts:
    232
    hehe I'm planning on coming up with a video, I was close to doing it but I'm refining some things first. Right now is mainly getting all of the game functionality accomplish, trying different actions, obstacles, getting physics to look good. So is coming soon :)
     
    faraz likes this.
  5. dilmerval

    dilmerval

    Joined:
    Jun 15, 2013
    Posts:
    232
    faraz likes this.
  6. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    That is awesome! And I also love your idea of having the background "sun" rotating… nice touch!
     
  7. dilmerval

    dilmerval

    Joined:
    Jun 15, 2013
    Posts:
    232
    Thanks I appreciate it. Since we're on the subject and you guys seemed to have a lot of experience with this, if you look at my character animation it feels a bit odd, I think mainly the walking animation, I have a sprite with about 5 drawings for each move, but I've seemed some sprites with 20 to 30 drawings for a walk cycle, I guess is how smooth you wanted to be, what are you recommendations?
     
    faraz likes this.
  8. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    Ya it looks a bit like your guy is doing the moonwalk. I think you can just play with (increase) the framerate of the animation to better match the speed that the character is moving across the screen. I don't necessarily think you need more drawings per cycle.
     
    faraz likes this.
  9. DigiScot

    DigiScot

    Joined:
    Aug 23, 2013
    Posts:
    27
    Looks good Dilmer, I've done something very similar using pretty much the same method you are, only I added some bubble particles, adds a lot to that water feel.
     
    faraz likes this.
  10. faraz

    faraz

    Joined:
    Aug 4, 2014
    Posts:
    46
    ducklin and maria-dev like this.
  11. maria-dev

    maria-dev

    Joined:
    Sep 19, 2014
    Posts:
    10
    @faraz Metaballs are good for 3d games. but after making some changes you can modify it for 2d games .
     
    ducklin likes this.
  12. ducklin

    ducklin

    Joined:
    Dec 2, 2014
    Posts:
    3
    You just need to convert metaballs to 2d
     
  13. dilmerval

    dilmerval

    Joined:
    Jun 15, 2013
    Posts:
    232
    It's crazy I have been away for a long time since I created this post and when I login is the first thing I see it :)

    This little game has evolved dramatically where it all started as a stick man and then somehow don't ask me why but it turned out into this game. "SuperStick Game"

    Levels in Unity



    Levels in Unity


    Concept Art
     
    GarBenjamin likes this.
  14. martinflash

    martinflash

    Joined:
    Dec 16, 2014
    Posts:
    7
    great job
     
  15. Deep_Ak

    Deep_Ak

    Joined:
    Jun 24, 2015
    Posts:
    29
    Hey! I'm far too late to this post, i'm quite in the same position as you when you posted this. How did you achieve the sun light effect ? And did you add some image effects? It looks amazing!
    Thanks in advance.