# Construction Script executing when a new cell is loaded (World Partition)

**URL:** <https://forums.unrealengine.com/t/construction-script-executing-when-a-new-cell-is-loaded-world-partition/2202918>\
**Category:** World Creation\
**Tags:** unreal-engine, Blueprint\
**Created:** [December 11, 2024, 11:10am UTC](https://forums.unrealengine.com/t/construction-script-executing-when-a-new-cell-is-loaded-world-partition/2202918 "2024-12-11T11:10:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SawyerGang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SawyerGang](https://forums.unrealengine.com/u/SawyerGang)\
**Post date:** [December 11, 2024, 11:10am UTC](https://forums.unrealengine.com/t/construction-script-executing-when-a-new-cell-is-loaded-world-partition/2202918/1 "2024-12-11T11:10:16Z")

</div>

Hello, I’m having an issue with World Partition and the Construction Script.

From what I understand, the Construction Script is supposed to execute before the game starts and should therefore be cooked in the build. However, I’ve noticed that with World Partition, when I play and load a cell, the Construction Script of my blueprints runs again, which causes several problems:

1. It can cause stuttering if the Construction Scripts are heavy.
2. If I significantly increase my loading zone size, the game crashes with an infinite loop construction script executing.

How can I make sure my Construction Scripts only run before launching the game in the editor and not when I play?

---

<div class="post-metadata">

**Author:** ![Scarletioshub](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/scarletioshub/32/997665_2.png) [@Scarletioshub](https://forums.unrealengine.com/u/Scarletioshub)\
**Post date:** [December 12, 2024, 2:46pm UTC](https://forums.unrealengine.com/t/construction-script-executing-when-a-new-cell-is-loaded-world-partition/2202918/2 "2024-12-12T14:46:59Z")

</div>

To ensure your Construction Scripts only run before the game starts in the editor and not during play with World Partition, use the **“Has Authority”** node to control execution based on the server or client. Wrap editor-only logic with the **`WITH_EDITOR`** directive to prevent execution during runtime. Alternatively, trigger the Construction Script manually during initialization. Also, optimize the script to reduce stuttering and avoid heavy calculations during cell loading.

---

<div class="post-metadata">

**Author:** ![SawyerGang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SawyerGang](https://forums.unrealengine.com/u/SawyerGang)\
**Post date:** [December 16, 2024, 10:17pm UTC](https://forums.unrealengine.com/t/construction-script-executing-when-a-new-cell-is-loaded-world-partition/2202918/3 "2024-12-16T22:17:14Z")

</div>

Hello, thank you for your response. I tried using “Switch has authority” (I’m making a single-player game, so I’m not sure if it has any effect) and also “with editor.” It seems that the construction scripts still execute when the World Partition cell is loaded… ☹

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [December 17, 2024, 12:55am UTC](https://forums.unrealengine.com/t/construction-script-executing-when-a-new-cell-is-loaded-world-partition/2202918/4 "2024-12-17T00:55:18Z")

</div>

What exactly do you **think** onCreate means?

And why would you not expect it to run when you spawn something in?

Use a proper function call instead of hacking togeter with stuff you shouldn’t be messing with.

---

<div class="post-metadata">

**Author:** ![SawyerGang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SawyerGang](https://forums.unrealengine.com/u/SawyerGang)\
**Post date:** [January 6, 2025, 8:47am UTC](https://forums.unrealengine.com/t/construction-script-executing-when-a-new-cell-is-loaded-world-partition/2202918/5 "2025-01-06T08:47:33Z")

</div>

What exactly are you suggesting? And why are you avoiding giving a proper answer?
