UKismetMaterialLibrary::SetVectorParameterValue
#include "Kismet/KismetMaterialLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Sets a vector (color) parameter value on the current world's instance of a Material Parameter Collection.
Caveats & Gotchas
- • Logs a warning and does nothing if ParameterName doesn't match a vector parameter defined on the collection.
- • Takes an FLinearColor, so values are treated as linear color/vector data, not sRGB — if you're driving a color visually, convert from sRGB first or the result will look washed out or too dark.
- • Like SetScalarParameterValue, this is per-world and not replicated — call it on every machine (client and/or server) that needs the updated value.
Signature
static void SetVectorParameterValue(UObject* WorldContextObject, UMaterialParameterCollection* Collection, FName ParameterName, const FLinearColor& ParameterValue) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | UObject* | World context used to resolve the current world's collection instance. | — |
| Collection | UMaterialParameterCollection* | The Material Parameter Collection asset containing the vector parameter. | — |
| ParameterName | FName | Name of the vector parameter to set, as defined on the collection. | — |
| ParameterValue | const FLinearColor& | New value for the vector parameter. | — |
Return Type
void Example
Drive a fog color parameter from gameplay code C++
UKismetMaterialLibrary::SetVectorParameterValue(this, WeatherCollection, TEXT("FogColor"), FLinearColor(0.4f, 0.45f, 0.5f, 1.0f)); See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?