my c++ script does not call to BP function..

Hi!

  1. I create a new Actor based C++ class
  2. On the BeginPlay() I try to call a BP function:


//Source
#include "Misc/OutputDeviceNull.h"

void BeginPlay(){
   FOutputDeviceNull a;
   this->CallFunctionByNameWithArguments(TEXT("playAnim"), a, NULL, true);
}



  1. Save my class in VS, back to UEditor and compile successfully.
  2. Drag and drop my new class into the scene
  3. Press play, but BP class is not beging called…

This is the procedure i do each time i create a c++ class, what do i’m doing wrong?
The BP called is Level Blueprint, it has a “Add custom method” Node connected to a “Print String” Node.

Thanks…

For one thing you need to call the Super::BeginPlay in your BeginPlay method.

Level Blueprint’s are tricky. I believe you actually have to set them up in the level settings, they aren’t like normal actors that you drag and drop into a scene. I’ve also never tried calling a function the way you are, so I can’t speak to that (I would argue calling into BP functions that may/may not exist from C++ is bad form - rather use the BeginPlay BP event and just call your method from there).

oh man, i thought calling a level bp function was the same as actor bp function…
where to find level settings?

Thanks.