Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Getting one object position

Discussion in 'Shader Graph' started by Wojzax, Jul 13, 2020.

  1. Wojzax

    Wojzax

    Joined:
    Jul 22, 2014
    Posts:
    34
    Is there posibility of getting position of certain object in shader graph?

    I have wall shader with Vector3 variable in it (lets say it's position of a light). I want this Vector3 to be the same for every wall and so I can manipulate this vector.
    I know that there are custom nodes with, for example, main light direction. So I wonder if I can somehow get main light position and manipulate this main light to achieve what i want.
     
  2. SeriouslyNot

    SeriouslyNot

    Joined:
    Nov 24, 2017
    Posts:
    121
    @Wojzax
    Try the Position Node, and set the space to "object"
     
  3. Wojzax

    Wojzax

    Joined:
    Jul 22, 2014
    Posts:
    34
    i think I said it wrong, basically I want a global variable to automaticaly update shader property for every object that have this shader.