RealDocs

UKismetMathLibrary::Multiply_Vector2DFloat

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Scales a 2D vector uniformly by a scalar, returning (A.X*B, A.Y*B). The most common way to scale a direction or speed vector in 2D.

Caveats & Gotchas

  • The scalar B is applied to both X and Y equally. For per-axis scaling, use Multiply_Vector2DVector2D.
  • The parameter is declared as double in the header (UE5 double precision), but Blueprint exposes it as a float pin.

Signature

static UE_INL_API FVector2D Multiply_Vector2DFloat(FVector2D A, double B);

Parameters

Name Type Description Default
A FVector2D The vector to scale.
B double The scalar to multiply both components by.

Return Type

FVector2D

Example

Scale a movement direction vector C++
FVector2D Direction(1.f, 0.f);
float Speed = 500.f;
FVector2D Velocity = UKismetMathLibrary::Multiply_Vector2DFloat(Direction, Speed);
// Velocity = (500, 0)

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.