When the compile button is pressed the construction script will run 3 times.

Steps to Reproduce
  1. Open a new C++ Project
  2. Create a an actor component c++ code
  3. Name it MyTestComponent
  4. Add the following Code:


 UFUNCTION(BlueprintCallable, Category = "Test")
 void TestThing();


 int g_Runtimes = 0;
 void UMyTestComponent::TestThing()
     UE_LOG(LogTemp, Log, TEXT("It is running %d times."), g_Runtimes);
  1. Build code
  2. Start Project
  3. Create a new Blueprint (actor)
  4. Add the new component that was just created
  5. Create the attached blueprint
  6. Open the output log
  7. Click the compile button for the new blueprint
  8. Notice that the output log now shows that the construction script has run 3 times

Watch the video linked below for further reference:

[Link Removed]

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

Login to Vote

By Design
ComponentUE - Gameplay - Blueprint
Affects Versions4.7.5
CreatedApr 20, 2015
ResolvedApr 22, 2015
UpdatedJul 14, 2021