Change X location of particleFX

Hi,

I’m new to defold but really enjoying the experience up to now. Still getting my head around some thing though.
As a simple project to learn I have created a simple jetpack character. I am using hflip to swap the sprite when changing direction.

I also have a particlefx attached to the character object to give a jetpack effect. The issue I have after doing the flip the position of the particlefx is not correct I need to change the X location.

I am not sure how to do this. I don’t seem to be able to get the ID of the particlefx

The components of a game object have fixed positions and there’s no API to move them. Some alternatives:

  1. Put the particle fx in a separate game object and move that object
  2. Use two particle fx components, positioned left and right and only ever use one of them at a time
2 Likes

As an ex-beginner I would recommend Britzl’s first answer. You have to get used to putting everything inside its own GO in order to move/rotate/scale/position in many cases, it’s good practice to start now.

2 Likes

Thanks both,

Josh I think you are right at a beginners stage lets look at option one and not make it too complicated.

Again. Thanks for the quick reply and solution to you both.

2 Likes