UKismetMathLibrary::ResetVectorSpringState
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Resets a vector spring's velocity and previous-target tracking back to zero/invalid, as if it had never run. Use this before reusing a spring for an unrelated position or after a large discontinuity such as a teleport.
Caveats & Gotchas
- • Only clears the spring's internal state, not whatever Current value you pass into VectorSpringInterp next — reset that separately if needed to avoid the value snapping visibly on the next call.
- • Vector springs interpolate all three axes with a single shared Stiffness/Damping pair in VectorSpringInterp, so resetting only affects momentum, not per-axis behaviour.
Signature
static void ResetVectorSpringState(UPARAM(ref) FVectorSpringState& SpringState) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SpringState | FVectorSpringState& | The spring state to reset. | — |
Return Type
void Example
Reset a position spring after a teleport C++
void AMyActor::OnTeleport(const FVector& NewLocation)
{
UKismetMathLibrary::ResetVectorSpringState(PositionSpringState);
SmoothedLocation = NewLocation;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?