# 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, question, Blueprint, CPP\
**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:** 3\
**Page:** 2

<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 12, 2024, 8:05pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/21 "2024-04-12T20:05:19Z")

</div>

I like the 3rd option but I cannot see overridable equivalent, event or function on blueprint side. But I can imagine having BlueprintImplementable _init_ function I could then invoke e.g. from _PostInitializeComponents_ to keep it clean and organized.

The 2nd option (moving Super::BeginPlay at the end) might not be a good idea in my opinion. Technically speaking, I believe the parent class should not assume about implementation details in class that will inherit from it. Super::BeginPlay at the end may already change the state of the parent in a way the parent is not expecting.

I’ll try out **PostInitializeComponents** - thanks for pointing that out.

---

<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:** [April 22, 2024, 1:53pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/22 "2024-04-22T13:53:15Z")

</div>

> [@Altrue](#):
>
> 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.

IIRC this is exactly what I’ve done.

---

<div class="post-metadata">

**Author:** ![Domnias](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Domnias](https://forums.unrealengine.com/u/Domnias)\
**Post date:** [September 7, 2024, 3:54pm UTC](https://forums.unrealengine.com/t/blueprint-event-begin-play-called-before-c-parents-event-begin-play/301901/23 "2024-09-07T15:54:57Z")

</div>

I believe I had the same issue and made an example for it:  
test\_pc.h:

```auto
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "test_pc.generated.h"

UCLASS()
class MY_GAME_API Atest_pc : public APlayerController {
	GENERATED_BODY()

protected:
    void my_log_to_screen(const char* msg) {
        if (GEngine) {
            GEngine->AddOnScreenDebugMessage(-1, 20.f, FColor::White, msg);
        }
    }
	virtual void BeginPlay() override {
		my_log_to_screen("BeginPlay call started");
		Super::BeginPlay();
		my_log_to_screen("Super of BeginPlay finished");
		if (IsLocalPlayerController()) {
			OnPossessedPawnChanged.AddDynamic(this, &Atest_pc::process_pawn_change);
		    my_log_to_screen("Bind finished");
		}
    }

    UFUNCTION()
	void process_pawn_change(APawn* old_pawn, APawn* new_pawn) {
		my_log_to_screen("Process pawn change called");
	}
};

```

bp\_test\_pc:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/6/0d6e73639362ed8616289ba12996ee894c86d4b0.png)

bp\_test\_gm:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/9/6b935f8e09da3670e7314a7079dd6b790e0822a5.png)

output:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/8/fc82c5f332afe2256fc1a0ac0e1f8a918c233bb8.png)  
From the output it seems like execution order is reversed.

Adding a delay:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/a/a5a4459ff53eb733e1897dc569ebc3d742c2511b.png)

Or in the C++ class moving the Super::BeginPlay() at the end of the BeginPlay() function solves the order issue:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/0/d60d68e2d97c3e4e5ae15a0927aed369d65a8dfc.png)

But as a software engineer this looks terribly wrong. Using another function other than BeginPlay() feels like a workaround for a bug in BeginPlay (same for moving it the Super::BeginPlay() to the end), as BeginPlay is widely used in tutorials (including Epic’s) and also in generated c++ classes.  
This looks like a bug to me.

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