How to feed a transform.position into shader graph?

I am trying to mask a sprite by using shader graph.

Here is a picture of what I have so far:


my problem is that when I feed the mask texture into the shader it centers itself on the main texture, as you see in this image.

See the slightly transparent checkerboard to the right side of the character? I only want this operation to affect the parts where the checkerboard intercepts with the character.

For this I would need someway to displace and scale(?) the mask texture so that it detaches from the center of the main texture.

What nodes do I have to add to accomplish this? Thanks.

There’s an Object node that has a Position output value.
Alternatively, if it’s a position value for something else in your world then you need to make a Vector3 property on your properties panel to the left that you can then assign a position to from a C# script.

thank you, I had found how to add a vector3 property to the shader, and also how to manipulate the values through code, but I have no clue where to plug the vector3 in the nodes, could you tell me where I would connect it?

I tried to connect it to the mask texture sampler UV node, but it just makes the mask loop around the sprite if I have the texture in repeat mode and in clamp mode it just does not work as intended. ( Im probably not supposed to plug it in the UV node right? )

Thanks for the response

Did you ever solve this?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ShaderName : MonoBehaviour
{
    public static int sgProperty= Shader.PropertyToID("NameOfPropertyInShaderGraph");
    private Transform objPos;
    private Material m;

    void Start(){
        objPos = GameObject.Find("The object you want to get the position of").transform;
        m = GetComponent<Material>();
    }

    void Update(){
        m.SetVector(sgProperty, obj.position);
    }
}