AActor::CreateComponentFromTemplateData
#include "GameFramework/Actor.h"
Access: public
Description
Creates a component instance from pre-cooked serialized data, allowing Blueprint component construction to bypass the more expensive template duplication path used in the editor.
Caveats & Gotchas
- • This fast path is only valid in cooked builds; in non-cooked (editor) builds the engine falls back to CreateComponentFromTemplate automatically.
- • The FBlueprintCookedComponentInstancingData struct is generated by the Blueprint compiler at cook time — never construct one manually; incorrect data will silently produce a broken component.
Signature
ENGINE_API UActorComponent* CreateComponentFromTemplateData(const struct FBlueprintCookedComponentInstancingData* TemplateData, const FName InName = NAME_None); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| TemplateData | const struct FBlueprintCookedComponentInstancingData* | Pre-cooked instancing data generated at cook time to fast-path component creation. | — |
| InName | const FName | Desired name for the new component instance. | NAME_None |
Return Type
UActorComponent* Example
Called automatically by the Blueprint VM at runtime C++
// This is called by Blueprint construction script machinery.
// You will not call it directly in game code.
// Understanding when it runs:
// - Editor builds: CreateComponentFromTemplate is used instead
// - Cooked builds: this function is called for faster spawn times Version History
Introduced in: 4.15
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?