playMaker

Author Topic: Finding Objects Directionally [SOLVED]  (Read 2673 times)

Scottyboombotz

  • Playmaker Newbie
  • *
  • Posts: 9
Finding Objects Directionally [SOLVED]
« on: December 16, 2011, 01:08:05 AM »
How do I find objects in front (or to the left, the right, behind) the player?  All I can find is Find closest, but my game is on a grid so the points I'm looking for will always be equal distant from the player.  I just need a search that uses directionality as a predicate for the search.  
« Last Edit: January 14, 2012, 08:25:49 PM by alexchouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Finding Objects Directionally
« Reply #1 on: December 16, 2011, 04:36:29 AM »
Hi,

 The best way to do that is to use colliders, since it's on a grid, set one collider on each adjacent grid and attached this to your player, then as the user will move or enemies, enemies and objects will trigger on them colliders and you'll know where they are located compare to your player ( because an enemy collided on the left collider, or the front collider, etc). It's super easy and very efficient.

If you don't get what I mean, I can do a quick example.

 Bye,

 Jean

Scottyboombotz

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Finding Objects Directionally
« Reply #2 on: December 17, 2011, 05:00:03 PM »
That should work perfectly.  Thanks, I can't believe I didn't think of that.