vxv
Junior vMember
Posts: 31
|
Post by vxv on Jul 28, 2018 12:48:25 GMT
Hi.
I have a script to add a fog effect when underwater. The script is attached to the Invector Camera but it is not working.
Is it something I must add to this ? (I "commented" unnecessary part for this)
//using ..... public float waterHeight; private bool isUnderwater; private Color normalColor; private Color underwaterColor; // Use this for initialization void Start () { normalColor = new Color (0.5f, 0.5f, 0.5f, 0.5f); underwaterColor = new Color (0.22f, 0.65f, 0.77f, 0.5f); } // Update is called once per frame void Update () { if ((transform.position.y < waterHeight) != isUnderwater) { isUnderwater = transform.position.y < waterHeight; if (isUnderwater) SetUnderwater (); if (!isUnderwater) SetNormal ();
//void setnormal and setunderwater ...
ps. if there is a way to attach effects with invector script please guide me.
Thank you!
|
|
|
Post by Invector on Jul 30, 2018 17:36:55 GMT
This doesn't look like anything regarding Invector included features, so I moved to GameDevelopment Discussion area.
If your script is working correctly, you can enable/disable this component with the swimming inside/outside water events.
|
|