playMaker

Author Topic: FindClosest2 filter by layer option  (Read 3285 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
FindClosest2 filter by layer option
« on: March 25, 2014, 07:10:36 AM »
Hi,

 Ok, following a request, please find a new version of FindClosest which allows you to filter by layer ( using a layer mask actually, so great flexibility here).

 I am experimenting with a new distribution system for custom actions ( as well as samples and templates), so now I will start hosting all the actions on a public repository for better tracking a more organized system.

 FindClosest2.cs

Right click on the link above to "save as" or click on it to preview it, you can then download it on your computer as well ( using save page as for example).

 Don't hesitate to give feedback on this. I am working on an editor wizard, embedded inside Unity, so you it will all be automated soon ( so that you can get dependancies, custom editors all in one click :) )

Bye,

 Jean
« Last Edit: March 27, 2014, 06:33:50 AM by jeanfabre »

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: FindClosest2 filter by layer option
« Reply #1 on: April 02, 2015, 09:51:21 AM »
Hi Jean,
do I have the wrong idea about Find Closest/Find Closest2? I have a float variable to collect the Distance but it seems to be giving odd numbers.

I thought if my player was in the middle of the screen and my enemy was 3 units to the right it would display '3' and if the enemy was 3 units to the left it'll read '-3'.

Instead it seems to read out something else, like maybe it's position? I dunno.

Any help?

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 125
    • MABManZ.com
Re: FindClosest2 filter by layer option
« Reply #2 on: April 03, 2015, 11:11:24 AM »
The distance will never be a negative number. It's measuring the length from point A (owner) to point B (target)

The Vector3 Operator action should be able to get the numbers you are looking for (using the position values)