I’m experiencing a strange behavior. I have two objects that are taller than the screen and am trying to animate them sliding down the screen on top of each other. In order for the two objects to slide down on top of each other, I have the first object complete the animation at vmath.vector3(0, object_height-screen_height, 0) and pass “complete_slide” as the complete_function. The complete_slide function will continue sliding the object off the screen and begin sliding the second object down from the top of the screen. The problem I am having is calling go.animate in the complete_slide function using the same duration results in a slower animation.
Not sure if this is making much sense, but any help would be appreciated.
Sorry, it looks like I misunderstood how the go.animate function works. Thanks decoded for pointing this out. I guess my issue is illustrated as follows:
The screen height is 720px.
Object 1 has a height of 2048px and originates at 0,0.
Object 2 also has a height of 2048px and originates at 0,720.
The initial animation slides Object 1 down until the top of the object is displayed at the top of the screen.
At this point, I do not want any space between Object 1 and Object 2 so the complete_function starts a new animation sequence to slide Object 1 to the bottom of the screen AND starts the Object 2 animation that slides it down.
I suppose this is more of a technique issue than an animation issue. I have tried testing the position of Object 1 in the update function but there always seems to be a space between Object 1 and Object 2. Will try to simplify what I’m trying to do in a new project and post some code.
Here’s a simplified version of what I’m trying to do. You can see that when the top of the red block is displayed the bottom of the blue block begins its animation but the speed of the animation does not match and there is a space between the red and blue blocks.
You are using go.animate() with a fixed duration of 10 seconds but you do not animate the two blocks the same distance. They will move with different speeds since the distance isn’t the same. Try:
Ahhhhh, yes! As you pointed out my error was that the initial red block starts at the bottom of the screen and slides down the height of the block. The blue block starts at the top and slides down block_height-screen_height for the same duration of time, which results in a slower animation.