playMaker

Author Topic: Need help with selecting objects  (Read 1923 times)

masterr

  • Playmaker Newbie
  • *
  • Posts: 17
Need help with selecting objects
« on: September 14, 2016, 09:59:48 AM »
Hi. I have a problem with selecting a group of objects. Let me explain you step by step. I have a lot of asteroids, spaceships, cargo crates in my game which is under ``Selectable`` tag. Im using find closest action to select one which is closest to my ship. And there is a drone in my game which needs to find only closest asteroid to capture.  I cant use the find closest action because there are other objects with the same tag. I want only closest asteroid :) And i cant give another tag to the asteroids because i wont be able to select them with my spaceship then.  Nothing comes to my mind how can i solve this problem. That would be great if you could give me an idea about how can i make this.

Weedsh

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Need help with selecting objects
« Reply #1 on: September 14, 2016, 12:19:58 PM »
try to select first the closest object and check if it is an asteroid or not. and then go to the next closest. check if an asteroid by name or set a variable on the asteroid that says it is an asteroid and check the variable.  sry for my english ;)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Need help with selecting objects
« Reply #2 on: September 14, 2016, 06:41:43 PM »
hi,
There is a custom action called "Find Closest 2" on the Ecosystem
With that one you can find with tag AND layer so you can use that for your drone.

You can set the layer right next to the tag, it does not matter what name only the layer number

masterr

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Need help with selecting objects
« Reply #3 on: September 15, 2016, 07:05:57 AM »
hi,
There is a custom action called "Find Closest 2" on the Ecosystem
With that one you can find with tag AND layer so you can use that for your drone.

You can set the layer right next to the tag, it does not matter what name only the layer number

Thanks buddy. You are a life saver