How can I set the particle velocity to the vertex normal? VFX Graph

I’m using the VFX graph and trying to set the particle velocity to the inverted vertex normal to prevent particles from “leaving” the inside of my mesh. I’m new to VFX graph so I don’t know if I’m doing something wrong. This is what I have so far:

I’m not inverting the normals right now, I just wanted to see the particles following the vertex normal direction. Can anyone help me with this?

Your setup should be accesing normals just fine (i see you are multiplying by 0, but im guessing you have tried without that).

But still, if you can read the mesh, then it should be fine. Do you have “Read/Write” enabled on the mesh import settings?
image

From the docs ( Sample Mesh | Visual Effect Graph | 17.0.3 (unity3d.com))

Limitations

The Mesh sampling feature has the following limitations:

Thanks, Canijo (and I appreciate you answering my questions!). This was one of my issues earlier but there’s another problem that I just found here: I was setting the position to a random vertex position and trying to access the normals later using particleId. But Unity was setting the position randomly! So instead I made my random position setter and used particleId later. That solved the issue.
1qqq11aaa

1 Like