Actor Press and Release Question

ilovepixarilovepixar Member, PRO Posts: 28
edited November -1 in Working with GS (Mac)
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.

Comments

  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    use 2 condition in your rule, or nest 2 rules. The first checks for position of mouse is inside actor, the other checks for mouse button is up.

    Not being in a position to test on an iDevice, I'm not sure how that logic translates to said devices...
  • ilovepixarilovepixar Member, PRO Posts: 28
    When you mentioned that I had high hopes, but unfortunately that didn't work. I applied your rules in the actor that spawns and unfortunately is just deletes itself once you click.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    While I wouldn't be surprised if I am totally wrong on this one, can I ask a dumb question? Did you have the rule set to ANY or ALL? It would need to be ALL...

    Gurus, feel free to chime in at anytime and clear this up...lol
  • JGary321JGary321 Member Posts: 1,246
    When touch is pressed spawn actor

    In the actor use the rule

    If touch is inside then...blah blah blah

    Otherwise then...destroy
  • ilovepixarilovepixar Member, PRO Posts: 28
    I'm out at the moment, but I'll be sure to try this the moment I get home! Would this work for multiple touches?
  • ilovepixarilovepixar Member, PRO Posts: 28
    I still don't understand what my issue is- here is exactly what I have:

    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.
Sign In or Register to comment.