Is the an "On touched object end?"

Get help using Construct 2

Post » Sat Feb 22, 2014 12:16 am

Is there a touch condition for "On touched object end" or someway to trigger an action upon the release of a touched object? I've looked, but I'm not seeing it.

I have buttons to move between layouts and I don't want to load the next layout until the sprite button is released.

Thanks.
B
3
S
1
Posts: 39
Reputation: 405

Post » Sat Feb 22, 2014 12:25 am

just say when it is not in touch with your object but do not forget to add a trigger once while true otherwise it will trigger every tick
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Sat Feb 22, 2014 1:04 am

Roccinio wrote:just say when it is not in touch with your object but do not forget to add a trigger once while true otherwise it will trigger every tick


So something like this?

Condition: Trigger once while true
Add Another Condition: Touch - X Is touching "nextButton"
Action: System - Go to Layout "page2"

I'll give it a try.
B
3
S
1
Posts: 39
Reputation: 405

Post » Sat Feb 22, 2014 1:46 am

That didn't work, but thanks. Is there another way?
B
3
S
1
Posts: 39
Reputation: 405

Post » Sat Feb 22, 2014 3:21 am

I think combining On touch end + is Touching object does exactly that.
B
68
S
22
G
14
Posts: 1,485
Reputation: 16,561

Post » Sat Feb 22, 2014 8:13 am

sorry i should have been more detailed i did not notice that you are just starting out
lets name the object 'button'
create an instance variable for it . make a Boolean named 'touched' and set it false.
if touching 'button' ......... set 'touched' to true
you can set whatever you want here as well like opacity,to show that is pressed

if inverted touching 'button' (right click to see the inverted command)
is 'touched' ......... go to layout 'blah blah'
trigger once while true .......... set 'touched' to false

here you do not need the trigger once since we are using the boolean to filter out the situation but if you use an in game touch button for example for the player to swing a sword and when it is released to do something else it is needed otherwise it will check as true forever since you are not touching the button
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Sat Feb 22, 2014 10:44 pm

@Yann
Thanks! I will try that.

@Roccinio
Thank you for the longer explanation. I'm going to try that out too.
B
3
S
1
Posts: 39
Reputation: 405

Post » Thu Jul 10, 2014 12:34 am

thanks for the explanation, I should be able to implement this as well.
B
13
S
5
G
1
Posts: 119
Reputation: 2,292


Return to How do I....?

Who is online

Users browsing this forum: TRMG, Yahoo [Bot] and 13 guests