How to select just 1 actor when many at your finger touch
carlos.varela.com
Member Posts: 99
Hi guys,
My project is stoped since weeks for this matter, and I really will appreciate your help on this.
I have many actor in my game that collide between them, but without bouncing, not phisics, not moving from one side to another, I need to select just one actor in order to change the action or status, but the problem is that when I did touch, sometimes I touch more than one and the actor go crazy, one of them follow why I did spect to do, but the other just stop, or do another things, etc.
I have been creating a unique id for each actor, an actor attribute id, when spawn, and have a global attribute that I change to true or false depends the status or action that I need to apply and each actor check if it was touched and compare his unique id with the global attributes in order to do something or not, in the case that I was not touched or I am not the unique Id actor that was touched then I don't do anything or do another thing.
When I did touch an actor the other actor do another thing well, the problem is when some actors are the same moment when I did touch, the other goes well, but these collided, one do my action or status, but the other don't know what to do I think.
My project is stoped since weeks for this matter, and I really will appreciate your help on this.
I have many actor in my game that collide between them, but without bouncing, not phisics, not moving from one side to another, I need to select just one actor in order to change the action or status, but the problem is that when I did touch, sometimes I touch more than one and the actor go crazy, one of them follow why I did spect to do, but the other just stop, or do another things, etc.
I have been creating a unique id for each actor, an actor attribute id, when spawn, and have a global attribute that I change to true or false depends the status or action that I need to apply and each actor check if it was touched and compare his unique id with the global attributes in order to do something or not, in the case that I was not touched or I am not the unique Id actor that was touched then I don't do anything or do another thing.
When I did touch an actor the other actor do another thing well, the problem is when some actors are the same moment when I did touch, the other goes well, but these collided, one do my action or status, but the other don't know what to do I think.
Comments
Z index:
I did spawn all my actors when The scene begin, I think that each actor is positioned at different z índex adress, but not sure, because when I touch just one follow what I spect to do, I think that maybe it's the top actor, but not sure.
Every himself check his own unique id and if he was touched too, when touched I did set a global attribute of the actor that have right now the status of "touched", this the way I use to check if himself is the touched actor, then do some rules in order to change the actor direction or status, etc.
The problem is the other touched actors, I think behind this actor on top, that do the same check, and maybe trying to set the global attribute at the same time at this actor on top.
But the strange and curious is that just only one do the spected, but the other stop or do something not spected or crazy.
Any idea?