Conflict between "pick instance by UID" and "collisions".

From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hello, i have an issue with picking right instance of sprite from family.

    There is spawners family.

    When the spawner is on, it starts shooting bullets.

    Every bullets have variable that contain UID of spawner that spawn that bullet.

    When a bullet hit something, spawner firing that bullet must be deactivated.

    So i use the "collision of bullet with object" event to detect hit and "pick spawner by UID" to deactivate it.

    Everything works fine with any objects exept other spawners.

    There is a conflict of choosing right instance.

    Example:

    drive.google.com/file/d/1Tf1XGyza0NeJuxHswyiy4av3xo5KPomy/view

    LMB - activate/deactivate spawner.

  • You limit the instances picked with the 'on collision' event. You can use a sub event where you pick all instances of family 1 again (under system) and then limit instance by UID with the condition you have, that should work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm already tried "sub events" and "for each" methods without any result.

    //UPD

    Solved.

  • Why are you picking Family1, and not Spawner sprite directly?

    You can also use "System Pick All Family1" condition in a sub-event.

    Bullet on collision with Family1
    
    	Pick All Family1
    	Family pick by UID=Bullet.SpawnerUID
    
    
  • Why are you picking Family1, and not Spawner sprite directly?

    Because i need to work with family in my main project. And i try to make example project as similar as possible to main.

    You can also use "System Pick All Family1" condition in a sub-event.

    Good to know that method exist. But i think "for each" is better for almost all tasks. Because you can limit the amount of objects to be selected.

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