UKismetMathLibrary::Vector4_Assign
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Copies all four components of InVector into A in-place. Primarily useful in Blueprint where direct assignment of struct variables requires a 'Set' node.
Caveats & Gotchas
- • In C++ this is equivalent to the assignment operator (A = InVector) and offers no benefit over it. This function exists mainly to expose a mutable ref assignment to Blueprint scripting.
- • Because A is passed as UPARAM(ref), Blueprint treats it as an in-out pin. The original variable at the call site is mutated; no new vector is returned.
Signature
static UE_INL_API void Vector4_Assign(UPARAM(ref) FVector4& A, const FVector4& InVector) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | UPARAM(ref) FVector4& | The vector variable to assign to. Passed by reference and modified in place. | — |
| InVector | const FVector4& | The source vector whose values are copied into A. | — |
Return Type
void Example
Reassign an existing Vector4 variable in Blueprint (C++ equivalent) C++
FVector4 MyVec(0.0, 0.0, 0.0, 0.0);
FVector4 NewValue(1.0, 2.0, 3.0, 4.0);
UKismetMathLibrary::Vector4_Assign(MyVec, NewValue);
// MyVec is now (1, 2, 3, 4) See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?