How to calculate attraction force between local and world object when vfx is transformed

I’m currently struggling to implement a simple attractor logic when my VFX graph is placed in a rotated and scaled scene. The screenshots should illustrate the problem nicely:

Particle spawn at (0,0,0) and should be attracted by the black sphere.


This is the vfx graph I am using:

When the vfx graph is not transformed, the force calculation works nicely. As soon as I transform the vfx graph, everything is off.


Now I know why this happens, but I don’t know how to fix it. Any help would be greatly appreciated :slight_smile:

Btw: I also tried going this road (transforming attractor to local, also did not work)

Maybe you already found a solution. This is happening because you are using the force Node. So it will give your particle a velocity and then when going pass the target it should come back after a while. You should see it if you expand the lifetime of the Particle.

Instead you can directly use a set velocity which should give you what you want.

Thanks for the answer, but unfortunately, that does not work either. It works when having the transform local scale of the vfx at (1,1,1), but as soon as I transform it to (-1,1,1), it looks like this:

If you don’t want the scale to affect the effect you can pass the vfx in world space by clicking the local button in a context node. But you might have to track the origin position of the FX and set it manually. I’m not sure what behaviour you want by changing the scale of the FX.

9383300--1312448--upload_2023-10-2_13-4-56.png

To complete with that, you can use the “VFXProperty binder” component in the VFX game object’s inspector to fetch world transform of game objects in your scene