Manudog
(Manudog)
November 28, 2022, 11:15pm
1
Hello,
I have just started in C++, i have a static function that is called in BP and in this function I would like to call another function that is not static. What should be a simple manipulation, generates only errors that I do not understand.
void AClass::Method01(FString string01, FString string02) {
AClass class;
class.Method02(string01);
}
This code does not generate an error but makes the game crash at startup.
Thank you in advance for your help.
3dRaven
(3dRaven)
November 28, 2022, 11:46pm
2
void AClass::Method01(FString string01, FString string02) {
AClass class = myObjectClass->GetDefaultObject<AClass>(); // myObjectClass = class of object or TSubClassOf<> ).
class->Method02(string01);
}
1 Like
Manudog
(Manudog)
November 29, 2022, 12:22am
3
After several searches, here is the call that solved my problem
void AClass::Method01(AClass class, FString string01, FString string02) {
class->Method02(string01);
}