Search Unity

Question Getting position of local vertex before any transformations(rotations/scaling) are applied?

Discussion in 'Shader Graph' started by uneatenbreakfast_unity, Jun 4, 2023.

  1. uneatenbreakfast_unity

    uneatenbreakfast_unity

    Joined:
    Dec 27, 2017
    Posts:
    5
    In Shadergraph, how do I get a vertex's local position(just need the y) before any transforms (rotation/scale) are applied to it or it's parents?

    For context, I have a skinnedMeshRenderer model (a hair model) and I would like to mask the top half of it off, based on an arbitrary y value. Eg. any vertices above y50 will have it's alpha set to 0.
    But I'm having trouble finding the vertices y position if the model is animated,which has scale/rotation/position all changing.

    I want to just get the value of it before it gets transformed then do the y check.