How many function calls per tick?

Discussion and feedback on Construct 2

Post » Tue Feb 03, 2015 1:32 am

Hi, I just noticed something weird that was given me headaches for the past weeks.

I'm using latest stable version. I have 4 identical objects with a platform behavior and an ON_LANDED condition.. call a function.

The problem is that with one object there is no problem, but with 4 sometimes 2 of them hit the floor at the same time, I mean exactly at the same tick apparently, and when that happens it looks like 1 function call is perfomed, and the second one overwrites the first since only 1 object gets picked. Even when I'm passing the object's UID en each call.

As soon as put all the "function code" directly under the ON_LANDED condition, everything runs smoothly.


Any thoughts on that?
Image
B
51
S
12
G
6
Posts: 270
Reputation: 11,771

Post » Tue Feb 03, 2015 1:44 am

You may need a For each on the trigger to call the function for the two instances that occur at the same time.
ImageImageImage
B
71
S
19
G
157
Posts: 3,395
Reputation: 91,436

Post » Tue Feb 03, 2015 3:55 am

oh I missed that haha thanks
Image
B
51
S
12
G
6
Posts: 270
Reputation: 11,771

Post » Tue Feb 03, 2015 4:12 am

Did exactly same thing. ;)
B
54
S
17
G
7
Posts: 392
Reputation: 7,328


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests