Pin Behavior Bug

Bugs will be moved here once resolved.

Post » Sat Apr 22, 2017 3:06 pm

I've had this problem many times. When I pin a few objects to a same one (position & angle or position only), some objects (together with their instances) have a delay in their changing position when the object they are pinned to is moving, while the rest of the objects are fine.
So, if you have an object A moving right, and there is another object B pinned to it, object B will trail behind object A and the faster object A is moving, the bigger the distance between A and B will become.

I've had this bug A LOT of times, and I've no idea how to deal with it and what's causing it..
B
19
S
7
Posts: 139
Reputation: 1,770

Post » Sat Apr 22, 2017 5:02 pm

I believe it is a limitation due to how construct handles objects. But yea, I would like this issue resolved too.
My guess is that When one object gets repositioned, the pinned object only knows it was repositioned on the next game tick/cycle, so there's always a one frame delay between them.

here's some info I found by doing a quick search.
Ashley wrote:I'm afraid I don't think this can be fixed: the Pin behavior is already coded to run *after* the events so it gets the latest position of the object. As you can see from this modified example there is no lag at all if you only use a single pin:

http://dl.dropbox.com/u/15217362/nopinlag.capx

The problem comes from using two behaviors at once. Construct 2 does not run behaviors in any particular order. So in this case the pin behaviors run in the wrong order and the second pin updates before the first, so it is always one frame behind. I don't think there's any good fix for this - it's how the engine has always worked. It's easy to workaround with events though, the Pin behavior is pretty simple. I'm afraid this appears to be the only solution. If you do it all by events you have exact control over the order it happens in, anyway.Ashley2012-02-20 22:25:33
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Sat Apr 22, 2017 6:08 pm

Hmm, okay.. Thanks for the useful info!
B
19
S
7
Posts: 139
Reputation: 1,770

Post » Thu Jun 22, 2017 3:36 pm

Closing, please see the bug report guidelines.
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests