How do I Make object with same variable Visible {solved}

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • The issue was having a test particle system around at start of scene and not deleting it before I instantiated new ones for each laser pod.

    Hello Constructors.

    I am having trouble making an object with the same variable visible on toggle. I make a variable on a particle system the same as the creating objects UID so that they are tied together with this number. It looks right to me but is clearly not. Could I get a hand with this?

    Here is an image of the issue:

    toggle_particle_effect by kessler_3, on Flickr

  • Could you share the screenshot of the code where you assign this var_UID to both objects?

    Actually, the name "var_UID" is quite confusing, which object's UID it is supposed to be?

    If you want to tie prt_laser to obj_laser, you only need to create this instance variable on one of the objects (prt_laser), not both.

    Rename prt_laser.var_UID to prt_laser.obj_laser_UID

    Remove obj_laser.var_UID

    When you create your particles, do this:

    prt_laser.obj_laser_UID = obj_laser.UID

    When you want to pick particles tied to your laser, do this:

    prt_laser -> Compare instance variable -> obj_laser_UID = obj_laser.UID

    Or you can simply add both objects to the same container. They will be spawned together, destroyed together and when you pick laser instance in your events, its corresponding particles instance will be picked automatically.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the response Dop2000. I think i have found a bug. my code works perfectly with a regular sprite but not with a particle system for some reason. I will do some more testing.

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