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
58
S
13
G
6
Posts: 271
Reputation: 12,128

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
22
G
258
Posts: 3,791
Reputation: 143,198

Post » Tue Feb 03, 2015 3:55 am

oh I missed that haha thanks
Image
B
58
S
13
G
6
Posts: 271
Reputation: 12,128

Post » Tue Feb 03, 2015 4:12 am

Did exactly same thing. ;)
B
58
S
18
G
13
Posts: 447
Reputation: 10,740


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests