playMaker

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

Scottyboombotz

  • Playmaker Newbie
  • *
  • Posts: 9
    • View Profile
Finding Objects Directionally [SOLVED]
« on: December 15, 2011, 11:08:05 PM »
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, 06:25:49 PM by alexchouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14338
  • Official Playmaker Support
    • View Profile
Re: Finding Objects Directionally
« Reply #1 on: December 16, 2011, 02: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
    • View Profile
Re: Finding Objects Directionally
« Reply #2 on: December 17, 2011, 03:00:03 PM »
That should work perfectly.  Thanks, I can't believe I didn't think of that.