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 /
This question was closed Feb 09, 2014 at 09:19 PM by Chaosgod_Esper for the following reason:

Answered the Question with help of a Friend :)

avatar image
0
Question by Chaosgod_Esper · Feb 09, 2014 at 02:21 PM · shaderwater

Change Water via Script?

Hi there

I added the Nighttime Water to my Scene, and manipulated the XYZ/Wind WaveSpeed values. Now, in a different scene, i need other valuas.. but changing them back is changing back the values on the other scene too..

Like all water in the complete game is linked together..

So now my question:

How can i change the values of the water via script, to edit them within each scene?

Like:

 using UnityEngine;
 using System.Collections;
 
 public class Scene_SetupScript : MonoBehaviour {
     
     public GameObject Water;
     public Vector4 Waterspeeds;
     
     // Use this for initialization
     void Start () {
         if(Water != null){
             
         }
         
     }
 }



?

Comment
Add comment · Show 3
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 Vardan Meliksetyan · Feb 09, 2014 at 03:45 PM 0
Share

What variables you want to change. In you code you can change in Start() funciton at start time one time, if you want to change not one time you must use void Update() { } function , !

avatar image Chaosgod_Esper · Feb 09, 2014 at 09:19 PM 0
Share

okay.. i think you didn´t get it.. I want to change variables of a Shader.

This one helps.. so.. it´s solved:

 go.renderer.material.SetVector("WaveSpeed", new Vector4(x1,y1,x2,y2));
avatar image Ratboy601 · Aug 01, 2014 at 07:32 AM 0
Share

Is there a way to use this code without it instantiating a new material? I just want to change the values of the existing material. $$anonymous$$anually changing the vector in the editor(at runtime) does exactly what I want, but this script causes the main texture to stop scrolling entirely, and leaves only the bump map scrolling. Ideas?

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

20 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I've lost the water shader [FX/ water (Simple)] 1 Answer

Shader not found in my application after build 1 Answer

On Collision with water buoyancy and play Swim animation 1 Answer

Low Poly Water 4 Answers

How can I make subnautica style water? 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