How do I make particles retain properties for each instance.

0 favourites
  • 4 posts
From the Asset Store
Particles support animations, collisions, effects and etc.
  • Ok, I apologize if this is oddly worded, but bear with me here.

    So I'm trying to use a particle effect to create a small dust cloud every time my player lands.

    I created the object, and configured the particle to have the properties that I want, and placed it in the layer out of view (since I can't call it without it already existing within the project).

    I setup my character object to create the particle object on landing; simple.

    When running a preview, my character lands on the ground, and the particles appear, but they are set to the default settings (as in the settings before I modified them) for the particles.

    I made sure that when I changed the properties of the object/particles that I didn't just have a single instance of it selected, rather I clicked on the it via the projects tab, and changed the properties before every dragging the first instance of it into the layout. To make sure I configured it right, I took the particle object that I already had in the layer and put it in a place where I could see it upon starting up the project, and it works fine.

    How do I set it up so that every time my player object lands the particles retain the custom settings?

  • You have to have an initial instance in the layout because this is where it takes the properties from. IID identifies the object instance, and the version of the Particle object with the lowest IID will be the one where the settings are taken from. It is possible that you have edited an instance of the Particle object that is not the first object of its type, it is taking the default settings from the first Particle you placed. You could create 100 Particle objects with different properties and on Create Particle object it would still use the settings of the first instance you added to the layout. Select the Particle objects in debug preview and look at the IID in the object properties, you will be looking on the left for Particles #0. The instance with the lowest IID will have the same properties as the one 'created'.

    Any of the Particle objects you place in view initially will always look correct as they can have separate settings, it is only when you use the Create Object action that it picks the settings from the lowest instance (unless you specify with conditions in the event sheet).

  • I tried it and it seems to be ok. <img src="{SMILIES_PATH}/icon_e_confused.gif" alt=":?" title="Confused"> (Press 'Space' to generate a new instance of an object that shares the same particle setting as the Player.)

    https://www.dropbox.com/s/x72da9qdngtn0 ... .capx?dl=0

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I didn't notice (or forgot to mention) that all properties except for the angle were carrying over.

    Thanks Gmoney, looking at your capx I was able to figure out how to get it working. All I had to do was define the angle of the particles when they spawn, rather than relying on the properties of the particle object that I had in the layout.

    To summarize:

    1.) I made a particle object, defined its properties, and put one instance of it in the layout outside of view.

    2.) After making the player object spawn the particles on landing, all custom properties from the particle object were showing up, except for the angle.

    3.) In the event sheet, I defined the angle of the particles on their creation by the player object, now it works great.

    Thanks for the help!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)