Touch Released Bug
Flamingbanana
Member, PRO Posts: 90
Hey Everyone!
I'm currently working on a project that a company is paying me to do and I am showing it to them tomorrow. I have been working on an undo system for this game. But it's been a hassle to get it to work and now I think I finally got it hammered down except for one really important detail.
When I pick up an object then say "when touch is released & some other rules: 'do my stuff' " but then GameSalad is saving that it has been released. So when I have another rule that says "when touch is released & different stuff then 'do other stuff' ". So later when my second rule's conditions become true then everything I have in it happens.
Why is it doing this? I mean it kinda makes sense but it shouldn't save that it's been released. If someone has a work around I would be eternally grateful! I'm losing my mind here :O
Thanks!
-Tad
I'm currently working on a project that a company is paying me to do and I am showing it to them tomorrow. I have been working on an undo system for this game. But it's been a hassle to get it to work and now I think I finally got it hammered down except for one really important detail.
When I pick up an object then say "when touch is released & some other rules: 'do my stuff' " but then GameSalad is saving that it has been released. So when I have another rule that says "when touch is released & different stuff then 'do other stuff' ". So later when my second rule's conditions become true then everything I have in it happens.
Why is it doing this? I mean it kinda makes sense but it shouldn't save that it's been released. If someone has a work around I would be eternally grateful! I'm losing my mind here :O
Thanks!
-Tad
Comments
What you need to do is create a boolean attribute called "been touched" and then do the following:
if touch is pressed:
-change "been touched" to true
if touch is released
-after 0.1 seconds change "been touched" to false
if touch is released and "been touched" is true (and any other rules you have that trigger the code):
- **place your code here**
There's a video somewhere on youtube that explains this, I forget what it's called though.