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(); }If a Blueprint event graph contains a Begin Play node that connects to a call to the parent function, the functionality present in the Blueprint Begin Play segment is run before the parent Begin Play functionality occurs.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = TestCat)
float TestNumber;
TestNumber = 3.f; GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Cyan, FString::SanitizeFloat(TestNumber));
RESULT:
The output from the Blueprint Print String node displays 0.0 before the parent BeginPlay() function runs and sets the value of the variable to 3.0.
EXPECTED:
The parent BeginPlay() function runs first and sets the value of the variable to 3.0 so both output strings are the same.
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.7 |
Target Fix | 4.7.1 |
Created | Feb 19, 2015 |
---|---|
Resolved | Feb 21, 2015 |
Updated | Apr 27, 2018 |