# Create LocationVolume Actor By Script

**URL:** <https://forums.unrealengine.com/t/create-locationvolume-actor-by-script/843101>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, WorldPartition, question\
**Created:** [April 4, 2023, 9:10am UTC](https://forums.unrealengine.com/t/create-locationvolume-actor-by-script/843101 "2023-04-04T09:10:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liyangyang0901](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@liyangyang0901](https://forums.unrealengine.com/u/liyangyang0901)\
**Post date:** [April 4, 2023, 9:10am UTC](https://forums.unrealengine.com/t/create-locationvolume-actor-by-script/843101/1 "2023-04-04T09:10:03Z")

</div>

How to create `LocationVolume` Actor By python or cpp code or blueprint? I want to use these actors to manage the world partition.

---

<div class="post-metadata">

**Author:** ![liyangyang0901](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@liyangyang0901](https://forums.unrealengine.com/u/liyangyang0901)\
**Post date:** [May 24, 2023, 2:17am UTC](https://forums.unrealengine.com/t/create-locationvolume-actor-by-script/843101/2 "2023-05-24T02:17:04Z")

</div>

```auto
ALocationVolume* UDTBlueprintFunctionLibrary::CreateLocationVolume(UObject* Context, const FVector& Center, const FVector& Size) {
    ALocationVolume* LocationVolume = Context->GetWorld()->SpawnActor<ALocationVolume>(Center, FRotator::ZeroRotator);

    UCubeBuilder* Builder = NewObject<UCubeBuilder>();
    Builder->X = 1.0f;
    Builder->Y = 1.0f;
    Builder->Z = 1.0f;
    UActorFactory::CreateBrushForVolumeActor(LocationVolume, Builder);

    LocationVolume->GetRootComponent()->SetWorldScale3D(Size);

    return LocationVolume;
}

```

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 23, 2023, 2:17am UTC](https://forums.unrealengine.com/t/create-locationvolume-actor-by-script/843101/3 "2023-06-23T02:17:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
