GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do you make behaviours apply to nearest actor first? (Guitar Hero game)

Hey guys. Ive got a few projects on the go at the moment, including a Guitar Hero style game. The problem im having at the moment is that i want the closet actor to you to be the target. let me explain:
Say i have 2 buttons; Red button and Green button.
when a red target appears, you press the red button to destroy it.when a green target appears, you press the green button to destroy it. But if both the red AND the green target are on the screen at the same time, i want whichever button you press to apply to the nearest actor. So if the red target spawns, then the green one behind it, i want the buttons to affect the red target first, and ignore the green until the red has either been destroyed or has gone past you. If you press the red button, you destroy it, If you press the green button for the red target, you lose a life. Does that make sense? Anyone got any ideas? Cheers :)

Comments

Sign In or Register to comment.