Animated Array

What is the smart way to make a blueprint that animates a bridge of steps into place? I don’t want to do it as a block but rather as a rolling motion for several blocks.

The method I’ve tried for now looks tedious and maybe computationally expensive.

You can do it with an array of components, assuming this is all in a blueprint.

One timeline, and an array of components on the update pin.

Tell me if you need more info.

1 Like

I guess I’m lost as to how to make an array with offset timing for the animation. (to make the movement of objects roll in a uniform way.) If I use a delay, it just delays everything evenly.

Are those steps supposed to animate one at a time? Or are there multiple steps moving at the same time?

1 Like

Rolling piano chords. Not all the keys are pressed at once. (not my video. hopefully the analogy makes sense.)

I could do something like this. But this is ugly and I have to make a bunch of duplicate float tracks that are all offset. And if I have 30 objects… That is also tedious.

Normally, you would have 1 float track, and use lerp to move the object. That way, you can keep stuff that changes, out of the timeline.

I’m pretty sure what you want can be done procedurally, ie without having to store coordinates.

Is the rippling keys of the piano what you want, or is it something else? ( before I code something up ).

2 Likes

The thing is I was going to have a variety of rippling effects. Are you suggesting this can be done with construction scripts? Here is another video that might be helpful. (notice how the objecs are rotating freely before they lock into place. But they get sent back and start rotating freely once mario moves away.) So it is two things. The path can assemble itself as the player progresses. So the player controls the pacing of the assembling of the bridge. But at some point. The difficulty of the game increases and the player is no longer controlling the pacing of the bridge being assembled. That the game then assembles the bridge at a predetermined pace and the player just has to keep up with the pace of the assembling of the bridge. So I guess…

Easy Bridge level: Player based pace would just be lerps based on distance from the bridge piece?

Hard bridge level: Should I take the Easy bridge level and instead using the player position have a custom animation null object that runs through easy bridge level to facilitate the automated assembling process of the hard bridge level? (sorry I’ve been so difficult to explain this.)

Just to share ideas:

  1. 3 actors: 1 that will be the trigger (puller) for when the player is approaching, 1 that wil hover in X position to hold the tile hovering, 1 that is the tile/floor itself.
  2. Only place the trigger in the level; on begin play this trigger spawns the hover tile in a defined vector and the tile attached to the hover. The hover will have random rotation + nice hover effect.
  3. when the trigger is active, attach the tile to the trigger and lerp the transform. on end overlap attach back to the hover actor and lerp the tile to it.

Change the trigger overlap to take another actor and move it through a spline so that the player has to follow its pace (but player wont see this actor).

e.g.:
TileBridge
For the “hard” bridge:
hardbridge

Floating actor BP

Trigger "puller" actor BP

This is just to get it working… you could save yourself the each instance with a timeline and have 1 actor manage all the lerps and hovers, but that tales a bit more time to put together.

3 Likes

Yep, I was thinking of this same thing. Using overlap in combination with move component. I don’t know if “move component” is the right way to do things. But that is what came to mind when CWO mentioned “lerp”.

Welp, this didn’t work. I take it that move component doesn’t create instances of functions.

Delays don’t work well inside loops.

(out the top of my head) If you want to make it work so that a single actor manages the transitions, I suggest considering the following:

  1. Create the actor that will manage the transition. This will be the only class that will have tick enabled.
  2. Have each trigger tell that actor that the player has overlapped. This will add them in an array so that this actor can manage the states.
  3. Each platform should have a variable that holds current state (enum) and alpha (float). This class calls the a function that handles the lerp of each platform.

The way it would work is:

  • If trigger is overlapping pawn: Trigger informs manager and gets added to an array that is looping. Change state to “pull”, increment the alpha of the lerp (0 platform hovers, 1 platform is in bridge position). If alpha == 1.0, change state to “docked” (e.g.).
  • If trigger ends overlap with pawn: if its in array in manager, change state to “push” and decrement alpha calling the function of the lerp. If alpha == 0, change state to “floating” and remove from array.

Now, in c++ you can use custom float curves without timelines. Don’t remember if you can access their values in bp without a timeline node.

As alternative if you want all platforms to be in the loop and offset activate them from start → last with a delay: you could use MapRangedClamped.

Here is a quick example creating a zipper:

2 Likes