Search Unity

Water4 Pro - Issues with Prefabs

Discussion in 'Editor & General Support' started by RonHiler, May 20, 2013.

  1. RonHiler

    RonHiler

    Joined:
    Nov 3, 2011
    Posts:
    207
    Hey all,

    I'm having a strange issue with Water4. Maybe I'm doing something wrong. But I'm wondering if anyone has run into this before.

    I used the complex example of Water4 (from the standard assets folder) to use as a starting point. I ran my game and started messing with the various settings to see what worked. When I had something I liked, I wrote them down and stopped the game (cause ya know, settings changed at run-time revert).

    Much to my surprise, my new settings were not in fact overwritten by the pre-run settings (as normally happens). All the new settings were intact. "Well, okay", I thought, "the script must be changing your run-time values into design time values so that you can change the water in run-time. Fair enough".

    But then I looked back at the prefab. It's settings were also changed! Not only was my instance changed, the prefab was changed as well. No, I did NOT hit Apply in the prefab instance inspector. It just did it. I was very much not happy about that, I wanted to keep the original settings on the prefab so I could continue using it as a starting point later on.

    So, okay, I deleted everything. I deleted the water folder from the standard assets folder and re-imported the asset. This got me back to the original factory settings. I then made a duplicate of the complex water example prefab and called it "Arena Lake". I made an instance of Arena Lake in my game and again played around with its settings until I had what I wanted. I figured if it's going to mess with the prefab settings, I will at least still have a copy of the original factory settings intact.

    As before, changing the settings at run time changed the instance settings and the prefab settings. No surprise there. What did, however, surprise me was the it changed the settings of BOTH prefabs (Arena Lake AND the original example prefab).

    Alright, at this point, I have to ask, WTF?

    Why this worries me? Because I will end up with multiple bodies of water in my project, all with different settings. But it seems like if I change one, it will end up changing all of them. Apparently, all Water4 instances are mysteriously connected somehow, and any change you make to one will affect them all.

    I don't really understand what is going on with water. Why does it act differently from every other prefab? Why are changes I'm making at run time being carried into design time? Why are changes I'm making to an instance being applied to the prefab without me hitting the APPLY button? And finally, why will changing a setting on an instance of one propagate that setting into every single prefab of water in my project?

    And probably most importantly, how in the name of god am I supposed to create multiple bodies of water, each with different settings, so that I can play around with one of them without messing up the others?

    I'm probably doing something stupid. No doubt, there is a set of checkboxes somewhere in the water inspector that controls this behavior that I'm not seeing. Somebody enlighten me! :)
     
  2. cybalicist

    cybalicist

    Joined:
    Apr 15, 2013
    Posts:
    1
    I am having the same problem. My circumstance is that I have one water plane face up to show the water, and another face down in the same spot so that it looks real from under the water. Problem is, I need the face down side to be different from the face up instance, they react differently in real life, but the settings won't allow me to make changes to one alone.
     
  3. MisterGasman

    MisterGasman

    Joined:
    Dec 13, 2012
    Posts:
    2
    I have exactly the same problem. Changing 1 water4 object changes all of them...
     
  4. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I think it is because you are changing the material applied to the prefab. You have to duplicate de Water material, make the changes on it and apply to the new water.
     
  5. scarrow15

    scarrow15

    Joined:
    Jan 30, 2014
    Posts:
    14
    Yes but changing the settings on the new material applies the settings to the shader as well which in turns spreads those settings across the water plains.