Ticks within a tick?

Discussion and feedback on Construct 2

Post » Thu Mar 27, 2014 7:28 am

I have a problem I've ran into a few times, and I'm curious as to the reasoning. Anytime I do a "set sprite position to xy" and change the animation simultaneously, I actually see the new animation in the old position for the very beginning millisecond of the tick.

I do this in order to maneuver around having to use the platform/bullet tool for incredibly complex movements.

ie. I have a blob that is falling from the ceiling. I play the drop animation, and once finished, it needs to go to the falling animation. However in order to keep the "edge" of the blob on the wall, the origin image point can't move, so it needs to change position once the drop animation is finished in order to look smooth. If I do an "on animation finished, play "fall animation" & set sprite location to new location, I will see the sprite at the old location so fast that I can't even pause it in time, regardless of what order my code is in.

Is there a better way to do stuff like this?
B
44
S
12
G
1
Posts: 545
Reputation: 4,271

Post » Thu Mar 27, 2014 10:27 am

I have noticed the same behavior just very recently. In my case I wanted after an animation finished to play a new animation mirrored. For some reason (I confirmed it in the debugger), the last tick of the last frame of the first animation was mirrored, even if the mirror was not the first action of the "on animation finished" event. This happened every time.

My workaround is to add a 0.01 wait before the mirroring action.

So, in your case try this:

=>On "DropAnim" finish:
-System wait 0.01 seconds
-Set animation to "Falling" (play from...)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Thu Mar 27, 2014 4:53 pm

@eli0s - ah good find! I thought it was during the move, so I tried the wait action AFTER the set animation, which obviously didn't work. Thanks!
B
44
S
12
G
1
Posts: 545
Reputation: 4,271

Post » Thu Mar 27, 2014 5:05 pm

I'm glad it worked!
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests