Code Timelines Plugin Documentation

Code Timelines Plugin Documentation

In case you’re reading this page then you are likely interested in purchasing my Code Timelines Plugin for Unreal Engine 4, so thank you for that! This plugin offers a fast and easy way to play any timeline in your c++ code. Moreover, you can assign your own functions that execute in each tick of the active timeline.

Documentation Version: 1

Latest Plugin Version: 1

This document covers the functionality of the plugin. Specifically, it covers the following topics:

  • Integrating the plugin in your project
  • Supported Curves
  • Plugin Usage for all the available Curves
  • How to add multiple curves in a single timeline
  • How to execute your own code in each timeline tick

See sample uses of the plugin on my github repo

Here is a video demonstrating the use of the plugin:

Integrating the plugin in your project

After the installation of the plugin, make sure to add the following line on your .Build.cs file:

PublicDependencyModuleNames.AddRange(new string[] { "CppTimelinePlugin" });

This step is essential so your project can find the header files that come inside the plugin.

Supported Types

The supported curve types that you can play with this plugin are the following:

  • FloatCurve
  • VectorCurve
  • LinearColorCurve

In the following section we will see how to use the plugin with each curve.

1. Plugin Usage

All the functionality of the plugin resides in the TimelineHandleComponent.h. You need to include this file before the .generated.h include in order to handle any timelines.

In order to play any curve you need to do the following steps:

  1. Declare the component in your class.
  2. Add a curve to the component.
  3. Create a function in your class that will fire in each timeline tick.

The previous steps are necessary in all use cases of the plugin. Let’s explore how easy it is to play any timeline!

1.1 Plugin Usage – FloatCurves

In this section, we’re going to see how to play a timeline with a float curve and interpolate between different types based on our needs. In the following code, I have created an Actor with the following declarations in its header file:

Inside the constructor of your actor, create the TimelineHandleComponent using the following syntax:

TimelineHandleComp = CreateDefaultSubobject<UTimelineHandleComponent>(FName("TimelineHandleComp"));

Then, override the BeginPlay function as follows:

Then, provide the following implementation of the TickTimeline function:

That’s the whole code you need to play any timeline! The NewFloatValue is the interpolated value between the values we’ve entered in line 10 inside the BeginPlay function!

Compile your code, assign a curve to your Blueprint and play in the Editor to see your actor rise!

1.2 Plugin Usage – Available Interpolation for Float Curves

In the previous section, we saw how to interpolate between float points and call our own function that takes the interpolated float as a parameter.

The plugin contains three more callbacks that you can use in your code:

  1. OnFloatCurveVectorTickFunction, which is the delegate that takes a function with a FVector parameter.
  2. OnFloatCurveRotatorTickFunction, which is the delegate tha takes a function with a FRotator parameter.
  3. OnFloatCurveQuatTickFunction, which is the delegate that takes a function with a FQuat parameter.

Here is an example code for each callback:

Tip: Use the FQuat implementation when rotating in 3 Axis to avoid gimbal lock.

1.2.1 Plugin Usage – Same values warning

In case you’ve assigned the same initial and target values by mistake, the plugin will report the following warning inside your editor:

samevalueswarning

To solve this issue, assign different values inside the SetInitialAndTargetValues function.

1.3 Plugin Usage – Vector Curves

To play a Vector Curve in the TimelineHandleComponent, create the following property in your actor:

Then, inside the begin play function, type in the following code:

 

1.4 Plugin Usage – LinearColor Curves

To play a Linear Curve in the TimelineHandleComponent, create the following property in your actor:

Then, inside the begin play function, type in the following code:

1.5 Plugin Usage – Play options

The plugin offers the following playing options / functions:

1.6 Plugin Usage – Multiple Curves

You can assign multiple curves in a single timeline. To do so, declare two curves in your header file:

Then, inside the begin play:

Here is the implementation of the bound functions:

1.7 Plugin Usage – Finish Function

The plugin offers an easy way to call your own function when the timeline finishes. To do so, declare the following function in your header file:

Thank you for reading my documentation!

In case you have any problems with my plugin, do not hesitate to contact me!