How do I Functions/ ontap

Get help using Construct 2

Post » Tue Dec 09, 2014 11:32 pm

How come when I call a function I cant have an event under it with the "on tap" gesture?

My scenario is double tapping a weapon and calls a function to make a window that says "are you sure" with 2 objects for yes and no, each one does something different. But inside of the function where the window is created I can not add "On tap gesture" so I can not get it to work inside the function.
B
5
Posts: 18
Reputation: 261

Post » Tue Dec 09, 2014 11:39 pm

From what it seems using a function wont even help me because the code will not go back to where it left off before after the function has been called
B
5
Posts: 18
Reputation: 261

Post » Wed Dec 10, 2014 3:09 pm

colben22 if you want to learn about function then look at this tutorial

https://www.scirra.com/tutorials/823/creating-function
B
249
S
39
G
15
Posts: 1,952
Reputation: 40,579

Post » Wed Dec 10, 2014 4:17 pm

"On tap" is a trigger, as indicated by the green arrow next to it. "On function" is also a trigger, and Construct 2 only allows one trigger per event(including subevents), which is why you can't use "On tap" in a function. Instead, your "On tap" event should call your window creation function.

In relation to your second post, calling a function will return to the branch point after the function has completed -- I'm not sure what gave you the impression that it won't. If you're having issues, I'd suggest posting a capx so someone can help you out with the problem.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116


Return to How do I....?

Who is online

Users browsing this forum: eochranek, Unconnected and 17 guests