Niagara fx to ui element

In my project I have a power up meter. As you do tricks in the game we spawn Niagara fx on the player character, and set them to move to a specific part of the screen. The Niagara fx are handled in a scene component. When we spawn the fx using a key press event in the Niagara component it works how we want it to, moving to the point on the screen that it should go to. When we call an event from the character or another component, then it goes to the position in the world that aligned with where it should have gone to on the screen when it was spawned. Does anyone know why it would behave differently when called from another blueprint?

maybe it would help if you could share some of the setup. like some screenshots of the blueprints.

you need to make sure you are using the correct coordinate system, ui vs world.

I’m using the local to viewport on the meter i’m filling, then taking the pixel position and passing that to the niagara component. Then the niagara component uses deproject screen to world, and we’re using those output’s to set the niagara system’s attract position.

Initially I though the issue was due to us setting the world location that the particles should go to, and that once you moved in game the particles would always go to the location set when they were spawned. I later realized that when calling the function to spawn them in the niagara component the position they were attracted to would remain the same relative to the screen, but if it was called from a different class then the position in world remains the same.