gshelper.com "how to select overlapping actors"

micksolomicksolo Member Posts: 264
edited November -1 in Working with GS (Mac)
I've implemented my own solution to this - as of yet not quite working correctly. The way its done in the video and the top card demo doesn't quite suit my game as I'm spawning lots of actors in random order so I can't apply the SelfID in the instance. I have it setup so it applies a SelfID to each actor as its spawned, the SelfID mathces the total number of actors spawned so far.

When actor is spawned,
Chg GameTotalActors to GameTotalActors+1

When Spawned
Chg Attribute SelfID to GameTotalActors

This way each actor has its own unique ID.

Problem is, when they overlap each other, they are all still feeling the click and doing their actions, instead of just the actor on the very top.

The obvious way to fix this is that when an actor is pressed, their SelfID is saved out to an attribute, if more than 1 is saved it will take the highest number and apply that to another globalattribute "TopActorID". Then in the actor, if TopActorID = SelfID apply the rules.

Anyone know how this might be possible or another possible solution to this?

Thanks
Sign In or Register to comment.