Keyboard event acting strange in function

Get help using Construct 2

Post » Thu Sep 19, 2013 12:48 pm

Whenever I create a new keyboard condition in function, the Add condition menu available in two options only(Key code is down / Key is down). But when I add it outside the function, it appears as normal again.
B
23
S
9
G
3
Posts: 114
Reputation: 3,794

Post » Thu Sep 19, 2013 1:38 pm

This is a newbie question, please read the wiki or search the board.

The difference is outside of functions and so you can create events inside of events you just can create conditions.

I try to explain it short:

Events getting fired as soon as a condition is true and they normaly just get fired once while the condition is true.

Events images including mostly a little green arrow and their names starting with "On ...."

If it would be possible to create an event in a function it would never work cause no player could press a key in the same tick like your function get called.
Darklinki2013-09-19 13:47:59
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Thu Sep 19, 2013 1:50 pm

You need to phrase it like :
On Key Pressed > Call Function X
Function X > Do Action
B
46
S
16
G
76
Posts: 2,150
Reputation: 45,313

Post » Thu Sep 19, 2013 2:26 pm

Thanks for the answer.
B
23
S
9
G
3
Posts: 114
Reputation: 3,794


Return to How do I....?

Who is online

Users browsing this forum: vutankhoa2015 and 22 guests