# Blueprint "event begin play" called before C++ parent's "event begin play"?

**URL:** <https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901>\
**Category:** C++\
**Tags:** parent, event-begin-play, unreal-engine, CPP, Blueprint, question\
**Created:** [December 17, 2014, 9:11pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901 "2014-12-17T21:11:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![VSZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VSZ](https://forums.unrealengine.com/u/VSZ)\
**Post date:** [December 17, 2014, 9:11pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/1 "2014-12-17T21:11:40Z")

</div>

1. Create a custom game mode class in C++ (derive from AGameMode)
2. Implement Begin Play for this class and print a test string
3. Create a blueprint subclassing the C++, set this as the default game mode for your map.
4. In the blueprint implement the ‘begin play’ node and right click, ‘add call to parent’ to add a ‘parent:begin play’ node.
5. Hook the ‘parent:begin play’ node to a print string node printing a dummy string

When you play the level you’ll find that the print string of the blueprint’s “event begin play” gets called before the print string in the parent C++ class’s “begin play” which seems wrong.

Is this a bug or expected behavior? Does Parent:Begin Play in a blueprint only work if the parent is also a blueprint?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [January 13, 2015, 8:24pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/2 "2015-01-13T20:24:55Z")

</div>

Hi ,

I tried to reproduce this issue, and the results I saw were different from what you described. Let me tell you what I did, and if you can point out where you are doing things differently, that would help.

- Create a new code project using the First Person template.

- Build the project in Visual Studio.

- Open the project in the Editor.

- Add a new code class to the project derived from GameMode.

- Close the Editor.

- Override `BeginPlay()` in the new code class with the following code:

- Open the project in the Editor.

- Create a Blueprint from my custom GameMode class.

- In the Blueprint Event Graph, set an Event Begin Play node and connect it to a Print String node.

- Set the new Blueprint as the project’s GameMode.

- Start PIE.

What I was seeing is that the message from the code class is displayed, but the Event Begin Play node in the Event Graph was apparently not being triggered.

If you could also answer a few additional questions, that would be helpful.

- What version of the Engine are you using?
- Are you using the binary version installed by the Launcher, or did you build the Engine from source code?
- Does this happen in a brand new project as well, or only in your own project?

---

<div class="post-metadata">

**Author:** ![VSZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VSZ](https://forums.unrealengine.com/u/VSZ)\
**Post date:** [January 13, 2015, 8:50pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/3 "2015-01-13T20:50:54Z")

</div>

- I’m currently using 4.5.1 although I _think_ I tried it on 4.6 preview as well, it’s been a while so I don’t recollect to be honest
- I was using the binary version
- I haven’t tried reproducing it in a brand new project yet. Don’t think I have the time to test in the next few days but I’ll try to get back with a repro in the coming week or so.

Not sure if you see different results when you right click and add the call to parent: begin play?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [January 20, 2015, 11:32pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/4 "2015-01-20T23:32:30Z")

</div>

I just took another look at this issue using the binary 4.5.1 Editor (I had previously been using 4.6.1), and I ended up seeing the same results that I was seeing previously. When you get a , would you be able to provide the code you are using in the BeginPlay function of your base class and a screenshot of how you have your GameMode Blueprint set up?

---

<div class="post-metadata">

**Author:** ![VSZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VSZ](https://forums.unrealengine.com/u/VSZ)\
**Post date:** [January 25, 2015, 11:20am UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/5 "2015-01-25T11:20:04Z")

</div>

Hi , my project has changed quite a bit since I posted this bug and I don’t think I have an exact copy of the code I used to reproduce this earlier. I will try setting up the same behavior again and post back my results. Apologies for the late reply, I’ve been swamped with some other work lately.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [February 11, 2015, 11:00pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/6 "2015-02-11T23:00:24Z")

</div>

Hi ,

I completely understand about being swamped. If you happen to run into this issue again, or are able to narrow it down further, please let us know about any additional information you may come across. I will be marking this issue as resolved for tracking purposes, but please feel free to re-open it at any time.

---

<div class="post-metadata">

**Author:** ![Timbo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Timbo](https://forums.unrealengine.com/u/Timbo)\
**Post date:** [February 18, 2015, 3:16pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/7 "2015-02-18T15:16:02Z")

</div>

Hi ,

I have the same problem. The Blueprint BeginPlay function is called before its C++ parent.  
30366-

 ![30367-blueprint_beginplay.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/5/9/7592981ba3f5e5680413862eb0ea8220b893ace7.jpeg)

![30368-pie_view.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/3/c23148b8218ef6077d7b4a84e0026694e696100a.jpeg)

---

<div class="post-metadata">

**Author:** ![Timbo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Timbo](https://forums.unrealengine.com/u/Timbo)\
**Post date:** [February 18, 2015, 3:17pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/8 "2015-02-18T15:17:43Z")

</div>

I am using 4.7 Preview 8.

Timbo

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [February 19, 2015, 7:54pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/9 "2015-02-19T19:54:28Z")

</div>

Hi Timbo,

Thank you for the additional information you provided. With your assistance, I was able to reproduce this issue. I submitted a report about this to have it investigated further (UE-10138).

---

<div class="post-metadata">

**Author:** ![Timbo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Timbo](https://forums.unrealengine.com/u/Timbo)\
**Post date:** [February 20, 2015, 9:48am UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/10 "2015-02-20T09:48:56Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_03e7608c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_03e7608c](https://forums.unrealengine.com/u/anonymous_user_03e7608c)\
**Post date:** [February 21, 2015, 11:06pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/11 "2015-02-21T23:06:59Z")

</div>

Hey Guys,

The blueprint implementation of BeginPlay (AActor::ReceiveBeginPlay) is called from native code in AActor::BeginPlay().

If you want to call Blueprint implementation after the custom native code:

```
void AQATestActor::BeginPlay()
{
	TestNumber = 3.f;
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Cyan, FString::SanitizeFloat(TestNumber));

	Super::BeginPlay();
}

```

Cheers,  
M

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_03e7608c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_03e7608c](https://forums.unrealengine.com/u/anonymous_user_03e7608c)\
**Post date:** [February 21, 2015, 11:09pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/12 "2015-02-21T23:09:09Z")

</div>

Hey Guys,

The blueprint implementation of BeginPlay (AActor::ReceiveBeginPlay) is called from native code in AActor::BeginPlay().

If you want to call Blueprint implementation after the custom native code:

```
void AQATestActor::BeginPlay()
{
	TestNumber = 3.f;
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Cyan, FString::SanitizeFloat(TestNumber));

	Super::BeginPlay();
}

```

Cheers,  
M

---

<div class="post-metadata">

**Author:** ![hiili](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hiili](https://forums.unrealengine.com/u/hiili)\
**Post date:** [February 22, 2015, 7:29am UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/13 "2015-02-22T07:29:42Z")

</div>

Thanks for this answer! Perfect timing, as I am just about to start implementing something that this issue would have affected. 🙂

So the “Parent: Begin Play” blueprint node is actually a no-op in this case?

To me it seems that this behavior is a bit counter-intuitive and feels like going against what is standard in object-oriented programming (execution starts from the child’s overriding implementation, which is then responsible for calling the parent’s implementation). Of course, this is how it has to be in this case, but I think it would be good to document this behavior somewhere? Maybe here:

[Exposing Gameplay Elements to Blueprints Visual Scripting in Unreal Engine | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/Engine/Blueprints/TechnicalGuide/ExtendingBlueprints/index.html#executableandoverridablefunctions) → BlueprintNativeEvent

---

<div class="post-metadata">

**Author:** ![plojnitza](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@plojnitza](https://forums.unrealengine.com/u/plojnitza)\
**Post date:** [May 20, 2016, 3:30pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/14 "2016-05-20T15:30:07Z")

</div>

“Parent: Begin Play” blueprint node calls the Super if the parent blueprint.  
It has to do only with blueprints

[https://answers.unrealengine.com/questions/77597/child-tick-event-cancels-parent-tick-event.html](https://answers.unrealengine.com/questions/77597/child-tick-event-cancels-parent-tick-event.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [May 20, 2016, 7:27pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/15 "2016-05-20T19:27:04Z")

</div>

Hi Plosnita,

You are correct. The `Parent: Begin Play` node calls the Begin Play event of a parent Blueprint. The Begin Play function for a code class parent is always called.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d63fb426](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d63fb426](https://forums.unrealengine.com/u/anonymous_user_d63fb426)\
**Post date:** [August 6, 2021, 3:13pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/16 "2021-08-06T15:13:58Z")

</div>

IMO, in the scenario of `BeginPlay`, taking the parent CPP class as the blueprint’s actual class is more reasonable, and easy to understand. I think UE has some internal mechanical especially code generated by UHT.

---

<div class="post-metadata">

**Author:** ![kfpopeye](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kfpopeye](https://forums.unrealengine.com/u/kfpopeye)\
**Post date:** [January 6, 2023, 5:39am UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/17 "2023-01-06T05:39:56Z")

</div>

> [@anonymous\_user\_03e7608c](#):
>
> `GEngine->AddOnScreenDebugMessage`

This appears to have stopped working in UE5.1. Annoying.

---

<div class="post-metadata">

**Author:** ![diego.ba7op](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@diego.ba7op](https://forums.unrealengine.com/u/diego.ba7op)\
**Post date:** [December 2, 2023, 11:20pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/18 "2023-12-02T23:20:59Z")

</div>

Ran into the same.  
1 hour trying to figure out this. It’s super counter intuitive. Not sure if it’s documented.

---

<div class="post-metadata">

**Author:** ![esgaldir](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@esgaldir](https://forums.unrealengine.com/u/esgaldir)\
**Post date:** [April 11, 2024, 10:21pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/19 "2024-04-11T22:21:46Z")

</div>

Agree. Ran into this as well. How am I supposed to order initialization logic then? I would naturally expect that on begin play the C++ class populates variables and blueprint as a child class will work with already “prepared” stuff. I’ve seen people workarounding this using some Delay nodes but in my opinion this is not a solid solution. It feels very counter-intuitive indeed.

---

<div class="post-metadata">

**Author:** ![Altrue](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/altrue/32/1186768_2.png) [@Altrue](https://forums.unrealengine.com/u/Altrue)\
**Post date:** [April 12, 2024, 2:55pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/20 "2024-04-12T14:55:06Z")

</div>

I see three ways to go about it:

Either you can create a BlueprintImplementableEvent function which replaces your blueprint begin play. You can then call this function in your C++ code whenever you want, presumably at the start or end of the actual C++ BeginPlay.

Or, and this one is just a guess, you could try moving the “Super::BeginPlay” to the bottom of the C++ BeginPlay function. I don’t know if that’s what actually calls the Blueprint BeginPlay but that would make sense.

Finally, I do have to point out that using BeginPlay to inizialize values etc… _Might_ not be a valid use of UE’s Gameplay Framework. There are many functions in the C++ actor lifecycle, like [AActor::PostInitializeComponents](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Engine/GameFramework/AActor/PostInitializeComponents?application_version=5.3), that seem like they would be more suited to such work. Bypassing the need to control both BeginPlay’s execution order entirely.

[Next page](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901.md?page=2)
