How do I detect a touch release that's outside of my actor?
Like in my controls I have
If
-Touch Pressed
do
-Set a boolean to true
Else
-If
--Touch Released
-do
--Set a boolean to false
This is all fine except for when the I touch my actor and then drag my finger/mouse outside of the actor and release it there...then I don't know how to detect that in order to make it act like as if it was released while still on my actor.
My current solution right now is to make the actor (a control joystick) large enough and hope the user doesn't drag outside of that large area
Best Answers
-
Armelline Posts: 5,365
Yes. Except false for the second part, but I'm assuming that's what you meant The reason yours isn't working is because you added the touch is released part. So yours is doing exactly what you asked it to, that just doesn't happen to be what you want.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
-
The_Gamesalad_Guru Posts: 9,922
Ooh,ooh,ooh MR. Karter I know the answer.
You use the touch count. when touch.count = zero set to false
Answers
Why do you need the touch is released at all?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
So that i can set my boolean to false indicating that finger is no longer touching the screen to stop whatever action i was doing when it's true.
So you want to register the touch when it is anywhere on the screen, and want to register it when it is no longer touched anywhere on the screen?
If you're only needing to detect the touch inside of the actor, and the release of that touch, then just putting the false change attribute in the otherwise should work fine.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
I want it the boolean to be true if touch is inside my actor, and stay true while touched and switches to false if the touch is released anywhere on the screen.
This is what should happen with just a touch is pressed rule.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
How did you do it?
Just if
touch is pressed
then set boolean to true
else
set boolean to true
?