Actor Press and Release Question
ilovepixar
Member, PRO Posts: 28
I'm relatively new to GameSalad but I wanted clarification on something. Let's say you create an actor and you apply the "released" attribute to the actor. I've noticed that this only works if you initially click inside the actor first and then release which I found odd. Is there any truth to this? It's messing up my game because I'm trying to spawn actors at the fingertips of anybody touching the screen and destroying those actors the moment the touches that are inside of them are 'released.' How might I go about this?
Essentially I just need actors to spawn and constrain to multiple fingertips and then destroy themselves when the fingertip is released.
Essentially I just need actors to spawn and constrain to multiple fingertips and then destroy themselves when the fingertip is released.
Comments
Not being in a position to test on an iDevice, I'm not sure how that logic translates to said devices...
Gurus, feel free to chime in at anytime and clear this up...lol
In the actor use the rule
If touch is inside then...blah blah blah
Otherwise then...destroy
ATTRIBUTES:
Touch 1 X
Touch 1 Y
Is Pressed
Actors:
Touch 1 is my first actor and inside it says:
Constrain X position to touch 1 X attribute
Constrain Y position to touch 1 Y attribute
When ALL conditions are valid attribute "Is Pressed" is "no" then destroy this actor.
My second actor is the background actor that fills up the entire screen. Here is what is inside:
When All conditions are valid and actor recieves touch is pressed, spawn actor "Touch 1" and change attribute "Is Pressed" to "Yes"
OTHERWISE:
change attribute "Is pressed" to "No"
Then in this actor is has:
constrain attribute "Touch 1 x" to touches 1 x position
constrain attribute "Touch 1 y" to touches 1 y position
I'm stuck because the actor immediately deletes itself and I don't know what I'm doing wrong. I just want it to spawn when I press down and delete when I release. I'm probably doing something dumb, but I just can't find it and above is everything I've done.