Download

Why I can't spawn an actor deferred from class from Blueprints?

Hello,

I’m trying to spawn an actor deferred (and the calling to FinishActorSpawning) from a Blueprint. BUT to my surprise those functions are not exposed to blueprints, why exactly is that?

Checking the UFUNCTION code I can see they have ( BlueprintInternalUseOnly = “true” ) so it can’t be used from blueprints:


    /** Spawns an instance of an actor class, but does not automatically run its construction script.  */
    UFUNCTION(BlueprintCallable, Category = "Spawning", meta = (WorldContext = "WorldContextObject", UnsafeDuringActorConstruction = "true", BlueprintInternalUseOnly = "true"))
    static class AActor* BeginDeferredActorSpawnFromClass(const UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, const FTransform& SpawnTransform, ESpawnActorCollisionHandlingMethod CollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::Undefined, AActor* Owner = nullptr);

    /** 'Finish' spawning an actor.  This will run the construction script. */
    UFUNCTION(BlueprintCallable, Category="Spawning", meta=(UnsafeDuringActorConstruction = "true", BlueprintInternalUseOnly = "true"))
    static class AActor* FinishSpawningActor(class AActor* Actor, const FTransform& SpawnTransform);

Why?

Can I expose this functionality to blueprints safely if I make my own functions?
Thank you!