Search Unity

Question Animation interacting with endless column

Discussion in 'Animation' started by NikosMaster, Feb 23, 2021.

  1. NikosMaster


    Jan 27, 2014
    Hello! I do hope that this is the right place to ask about this. Not 100% sure if it should be under "Animation" or "Script" category, but here we go.
    I am making a form of mini game, where an "endless" tree moves upwards. The tree has 3 visible "pieces", and the player must choose an action according to the middle piece's sprite. Every a set amount of time OR when the player has performed an "action", the tree moves 1 piece upwards.

    Now, the tree actually has 5 pieces. Three in the middle which are visible to the player (1-3), and two that are invisible; One under the canvas (0) and one above the canvas (4). After each "shift" of the tree, all pieces move upwards in an animation.

    To put it simply, I've tried to make an endless column with 5 pieces (two hidden, three visible), which shifts every now and then upwards but never truly "ending". The problem is, since the animation resets once it is done, I need the sprites to actually "move" upwards. An easy script fixed that, but there is a split second that this shift is visible as the animation resets. (NOTE: After each reset, the bottom (0) piece is randomized)

    Is there a way without pregenerating the entire tree to make this transition seamless?
    Thank you.