Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Scottyboombotz on December 16, 2011, 01:08:05 AM

Title: Finding Objects Directionally [SOLVED]
Post by: Scottyboombotz 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.  
Title: Re: Finding Objects Directionally
Post by: jeanfabre 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
Title: Re: Finding Objects Directionally
Post by: Scottyboombotz on December 17, 2011, 05:00:03 PM
That should work perfectly.  Thanks, I can't believe I didn't think of that.