Summary
NsTween is a small yet powerful tweening framework for Unreal Engine. It allows smooth interpolation of floats, vectors and quaternions using a rich set of easing functions. Tweens can be controlled entirely through C++ or Blueprint nodes.
Features
- Multiple data types:
Float,Vector,Vector2D,Rotator,Quaternion,TransformandColorvalues. - Custom easing: Choose from many easing curves or drive interpolation via a user supplied curve.
- Warp mode: Built-in
Looping,DelaysandPing-Pongbehaviours. - Direction: Chose between
ForwardorBackward - Blueprint actions: Async Blueprint nodes for quick setup without code.
- Subsystem based: A Subsystem to handle all the active tweens.
- Tween-To-Tween Injection: Inject any different tween behaviour at any time into your current tween.
Requirements
Unreal Engine 5.2+
Installation
- Clone or download this repository.
- Copy the
NsTweenfolder into your projectβsPluginsdirectory. - Generate project files and enable the plugin when prompted.
Getting Started
Below is a minimal C++ example showing how to move an actor along the X axis using the fluent tween helpers built into FNsTween:
#include "NsTween.h"
void AMyActor::BeginPlay()
{
Super::BeginPlay();
FNsTween::Play(
/**Start*/ 0.f,
/**End*/ 100.f,
/**Time*/ 2.f,
/**Ease*/ ENsTweenEase::InOutQuad,
/**Update*/ [this](float Value)
{
SetActorLocation(FVector(Value, 0.f, 0.f));
});
}
The library also exposes Blueprint nodes for the same functionality if you prefer a visual approach. Below is a slightly more advanced snippet showing how to make an item float up and down while spinning for 10 complete loops
#include "NsTween.h"
void AFloatingItem::BeginPlay()
{
Super::BeginPlay();
// Float continuously
FNsTween::Play(
/**Start*/ GetActorLocation().Z,
/**End*/ GetActorLocation().Z + 40.f,
/**Time*/ 1.f,
/**Ease*/ ENsTweenEase::InOutSine,
/**Update*/ [this](float Z)
{
FVector CurrentLocation = GetActorLocation();
CurrentLocation.Z = Z;
SetActorLocation(CurrentLocation);
})
.SetPingPong(true)
.SetLoops(-1); // infinite loops
// Rotate and print 10 times the Loop
FNsTween::Play(
/** Start */ 0.f,
/** End */ 360.f,
/** Time */ 2.f,
/** Ease */ ENsTweenEase::Linear,
/** Update */ [this](float Yaw)
{
SetActorRotation(FRotator(0.f, Yaw, 0.f));
})
.SetLoops(10) // 10 full spins
.OnLoop([this]()
{
UE_LOG(LogTemp, Warning, TEXT("Spin finished"));
});
}
Road Map
API
Runtime Core
FNsTweenβ Runtime tween state tracking easing, wrap modes, delegates, and pause behavior.FNsTweenBuilderβ Fluent setup handle chaining specs, callbacks, activation, and control forwarding.UNsTweenSubsystemβ Game-instance subsystem ticking live tweens, processing commands, and allocating easing curves.
Data & Specs
FNsTweenSpec/FNsTweenCommand/FNsTweenHandleβ Blueprint-ready structs describing playback options, delegate hooks, queued commands, and handles.UNsTweenSequenceβ UObject sequence asset storing ordered tween specs for content-driven playback.
Blueprint & Async Surface
UNsTweenBlueprintLibraryβ Central Blueprint library spawning tweens, exposing ease presets, and forwarding subsystem controls.UNsTweenAsyncAction(base) β Shared async action base normalizing inputs, binding events, and managing lifecycle cleanup.- Typed async nodes β Float, vector, rotator, transform, and color broadcasts with curve overrides.
Strategies & Helpers
- Callback strategy / interpolators β Lambda-friendly callback strategies and templated interpolators supplying type-appropriate lerp math.
- Native value strategies β Native ITweenValue implementations initializing targets, applying eased updates, and ensuring completion.
Easing Implementations
FNsTweenPolynomialEasingβ Polynomial easing evaluator covering sine, expo, elastic, bounce, and back presets.FNsTweenBezierEasingβ Cubic Bezier easing solver inverting time with Newton steps before sampling output.FNsTweenCurveAssetEasingAdapterβ Adapter wrapping UCurveFloat assets to drive easing while falling back gracefully.
Tech Documentation Layout
Use the following map when you need to dive deeper than the high-level feature overview. Each entry mirrors the folder layout inside the plugin so you can jump straight from prose into the exact file that owns the logic.
Public Surface
Source/NsTween/Public/NsTween.hβ containsFNsTween::Playand the templatedBuildT<T>helpers that every example in the docs references.Source/NsTween/Public/NsTweenTypeLibrary.hβ enums, delegates, and light-weight structs used across the tutorials.Source/NsTween/Public/Interfaces/ITweenValue.hβ the strategy contract implemented by each type-specific value driver.Source/NsTween/Public/Templates/β header-only interpolators and callback strategies.
Runtime Flow
Source/NsTween/Private/NsTween.cppβ documents the lifetime of an active tween, including pause/cancel semantics and wrap modes.Source/NsTween/Private/NsTweenBuilder.cppβ shows how specs become runtime objects before entering the subsystem.Source/NsTween/Private/NsTweenSubsystem.cppβ central tick loop and allocation strategy for live tweens

