RealDocs

FMath::ApplyScaleToFloat

function Core Since 4.0
#include "Math/UnrealMathUtility.h"
Access: public Specifiers: static

Description

Applies a 3D scale delta to a single float in-place, intended for editor gizmo interactions where dragging a uniform scale handle should affect scalar properties.

Caveats & Gotchas

  • This is an editor utility — it is used by the engine's detail panels and transform widgets to adjust scalar properties via scale handles. Using it at runtime is valid but unusual.
  • The function picks the dominant non-zero axis of DeltaScale and applies that component multiplied by Magnitude to Dst. Passing a zero vector leaves Dst unchanged.

Signature

static CORE_API void ApplyScaleToFloat(float& Dst, const FVector& DeltaScale, float Magnitude = 1.0f)

Parameters

Name Type Description Default
Dst float& The float value to scale, modified in-place.
DeltaScale const FVector& A scale delta vector; the dominant axis component is used.
Magnitude float A multiplier applied to the scale delta before adding to Dst. 1.0f

Return Type

void

Example

Apply editor scale delta to a radius property C++
// Inside a custom component visualizer or detail customisation:
float Radius = MyComponent->GetRadius();
FMath::ApplyScaleToFloat(Radius, DeltaScale);
MyComponent->SetRadius(Radius);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.