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

0 favourites
  • 5 posts
From the Asset Store
Act on your instances, get/set their properties and variables only thanks to their UID. No more picking trouble! Plugin
  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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 with 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)