Check out our previous post about using Timeline Animations in Unreal Engine 4. We have discussed about the basic structure of blueprint Timelines in that post. Now we will create a simple example animation using Timeline Animations in Unreal Engine 4.
In this example we will be creating a simple bridge link which will get activated on a trigger.
- First of all we need to add a Cube static mesh and adjust its scale so that it looks like a bridge that we want to use for connecting two floors. In details panel , dont forget to set its mobility to “Movable”.
- Place this mesh below the first floor. It will be the initial position of your bridge mesh. In your level blueprint , use Event beginplay method to store this location into a variable.
- Now add a trigger box on first floor which will make our animation to play.
- On Overlap event of this trigger, we will check that whether the overlapping actor is our player, if yes then we will play Timeline animation to change the location of bridge from initial position to some desired final position.
- We are performing a “LERP” operation on X axis movement of bridge mesh. It is moving 400 units on X axis in certain time as defined in our Timeline node. Our Timeline node have defined a float variable, whose value is changing from 0 to 1 in one second, and this variable is used in alpha input of Lerp node. (Alpha value 1 denotes that transition from value A to value B is complete). So our mesh will change its position from its initial position to final position with a smooth transition effect. Timeline settings are as follows :
The keyframes are added using shortcut “SHIFT + LEFT MOUSE KEY” on graph.
Thats it. Now you have just created a simple Timeline animation using blueprints in Unreal Engine 4.
If you are having any doubts in mind, feel free to ask in comments.
Happy Game Making !! 🙂