UKismetSystemLibrary::SetSoftObjectPropertyByName
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Sets a named const TSoftObjectPtr<UObject>& property on Object to Value via reflection. Internal helper the Blueprint compiler generates for dynamic property-set nodes; not intended to be called directly.
Caveats & Gotchas
- • Marked BlueprintInternalUseOnly, so it never appears in the Blueprint node picker — the compiler emits a call to it automatically when a Blueprint node writes to this property type by name; you can't drag it onto a graph directly.
- • Unlike most of the sibling Set*PropertyByName functions, this one does not null-check the result of FindFProperty before dereferencing it — if PropertyName doesn't resolve to an FSoftObjectProperty, the call crashes rather than silently no-opping.
Signature
static ENGINE_API void SetSoftObjectPropertyByName(UObject* Object, FName PropertyName, const TSoftObjectPtr<UObject>& Value) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Object | UObject* | Object instance whose property will be modified. | — |
| PropertyName | FName | Name of the target property, resolved via FindFProperty against Object's class. | — |
| Value | const TSoftObjectPtr<UObject>& | Soft object reference to assign. | — |
Return Type
void Example
Set a soft object property by name from C++ C++
UKismetSystemLibrary::SetSoftObjectPropertyByName(TargetActor, FName("PreviewMesh"), TSoftObjectPtr<UStaticMesh>(SoftMeshPath)); Tags
Version History
Introduced in: 4.15
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?