#Why is my interface function firing before begin play
1 messages ยท Page 1 of 1 (latest)
Small update.
It happens on AActor::BeginPlay
[0038.59][616]LogTemp: Super::BeginPlay()
[0038.59][616]LogTemp: TESTING ACTOR, OVERRIDE MyNativeFunction
[0038.59][616]LogTemp: TESTING ACTOR HAS STARTED PLAYING
[0038.59][616]LogTemp: Calling C++ Function
[0038.59][616]LogTemp: TESTING ACTOR, OVERRIDE CPP MyInterfaceFunction
[0038.59][616]LogTemp: Calling C++/BP Function
[0038.59][616]LogTemp: TESTING ACTOR, OVERRIDE MyNativeFunction
[0038.59][616]LogTemp: Begin play has ended.
look where ReceiveBeginPlay is called within Super::BeginPlay
should make sense then
or rather i should just say, ReceiveBeginPlay is called within Super::BeginPlay
But my ide can't find definiton for ReceiveBeginPlay so i don't know is happening inside
i saw it is at the end
but why would it use interface function anyway
you're literally calling it?
no
void ATestingClass::BeginPlay()
{
UE_LOGFMT(LogTemp, Log, "Super::BeginPlay()");
Super::BeginPlay();
UE_LOGFMT(LogTemp, Log, "TESTING ACTOR HAS STARTED PLAYING");
UE_LOGFMT(LogTemp, Log, "Calling C++ Function");
MyInterfaceFunction();
UE_LOGFMT(LogTemp, Log, "Calling C++/BP Function");
//MyNativeFunction_Implementation(); // Always run C++
IMyInterface::Execute_MyNativeFunction(this); // Run Active version
UE_LOGFMT(LogTemp, Log, "Begin play has ended.");
}
First call is after begin play and logging so ๐คทโโ๏ธ
in your blueprint...
Why is my interface function firing before begin play
you run your blueprint graph (ReceiveBeginPlay)
your blueprintgraph runs your function
oh, wait maybe i see the confusion
wait, so I counted wrong ?
are you expecting that "Parent: BeginPlay" to run the C++ BeginPlay?
I think it should execute C++ Begin Play which is paren and then run rest of graph
so all messages should align
no, ReceiveBeginPlay and BeginPlay are totally different functions
BeginPlay is not a BlueprintNativeEvent
Always found that kind of weird but that's what Epic did
okok, ye I see, added small delay and seems in order ๐ค . At first I though it is redundant call ;d which could be a problem but its fine
so whats Parent: BeginPlay ? ReceiveBeginPlay?
I almost get it ๐
cause I removed parent beginplay and it still runs my c++ code heh
right, C++ BeginPlay is not a BlueprintNativeEvent
AActor::BeginPlay calls ReceiveBeginPlay
Where should i put code to be able to override body in editor ?
you cannot override ReceiveBeginPlay (BP Begin Play) in C++
can I define this node in C++ tho? :d
that's ReceiveBeginPlay