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

ShaderGraph question.

Discussion in 'Scripting' started by theraje3, Jul 3, 2019.

  1. theraje3

    theraje3

    Joined:
    Mar 16, 2014
    Posts:
    2
    Hello everyone! This is my first post on the forums. Help me plz

    I was playing a bit with shadergraph. Then I tryed to change a Vector3 input in realtime. To keep track of the player's position.

    It reads the info but never used it. here I drop some images to Ilustrate the problem.

    void Update:
    Code (CSharp):
    1. mat.SetVector("PlayerPosition",player.transform.position);
    2.         print(mat.GetVector("PlayerPosition"));
    3.         RenderBatches();
    the print result:

    the Vector3 I accesed:

    shader properties:


    So, when i change color in runtime it works just fine, but the vector3 position wont.

    Thx!
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Welcome to the forums! (well you been here 5 years, but welcome anyway :p ) You'll probably have better luck getting an answer to a Shader Graph question in the Shader Graph forum rather than the scripting forum.

    https://forum.unity.com/forums/shader-graph.346/