I decided to make my own post since I still couldn’t figure it out. I was following this Skinned Mesh Sampling post on skinned mesh sampling with the VFX graph in URP.
Everything works great except that I need the VFX to be a child of the RobotKyle gameobject so I can spawn it around the world, destroy it, etc.
However, whenever I move it into Robot Kyle’s hierarchy, the position is offset in a strange way.
I assume this is because the VFX graph is also using it’s own position when using the setposition node so it’s kind of doubling the position.
Is there any way to parent the VFX graph to Robot Kyle without causing this offset?
What I’ve tried:
I have tried to subtract the object’s position right before the setposition node, which works for the position, except the rotation doesn’t follow, but I don’t know how to subtract rotation.
If I understand correctly, your VFX system is in Local space and the Visual Effect component belongs to the Skinned Mesh Hierarchy, your are also applying the transform through the VFX Property Binder.
Thus, what you are observing is the translation of the root bone applied twice.
You have to choose between these two workarounds, either:
Remove the Transform from Position Binder
Move the visual effect component back in root hierarchy
If you look back at this sample the chosen solution was to have the Visual Effect Component in root hierarchy.
If you need the VFX to be a child of the RobotKyle gameobject", then, it’s probably more convenient to move the the VFX (assuming the system is still in Local Space) as child of the root bone (named ribs) insuring the VisualEffect component transform is identity.
We are aware this workflow isn’t ideal, we are improving this feature in 2022.2.a14 (not yet available), here an early preview (it explains the new settings field with Position Mesh in my previous screenshot):
The Position Mesh & Sample Mesh operator will directly include an option to integrate the root bone transform. You can also compose with an additional transform.
More information and documentation will soon be available.
Wow that worked!!! Thank you so much! I’ve been working on this problem for over 40 hours and it was as simple as putting the particles under the root bone and turning off the VFX binder. Additionally, since I wanted the particles to trail off in world space, I moved the position nodes into initialize particle and changed it to world space.
Same setup here: I have a graph that I need to be a child of the mesh it’s using as emitter source - but I also need it to be in world space. Is there any workaround for that?
Edit: I was dumb. It’s really as simple as Kimproduction wrote: parent your graph under the root bone, turn off any position binding, set any positioning in the graph in initialize, set graph to world.
Hello. From the look at your screenshot, you have a more recent Unity version. The Set Position Skinned mesh block has been updated and now has the option to apply either the World root transform or Local Root transform.
In your case, it’s applying the world root transform, so you don’t need to wire the transform properties in the transform slot.
You can take a look at this forum post where I’ve shared a small VFX package with a simple World Space system to attach to a Character skeleton.
Have a lovely day.