Calling c++ function from actor reference?

Hi all - I am very new to Unreal, not so new to C++, and in need of some help! I have a UserWidget in my game - when a button is pressed, I would like to run a function from a C++ code that locks or unlocks a door.

This is the function, .cpp:

void AMyActor::toggleLeftDoor(){
    if (leftLocked){
        //unlock it
        leftDoorTrigger->SetActorEnableCollision(true);
        leftDoor->SetActorEnableCollision(false);
        leftLocked = false;
        print("Left door unlocked");
    }
    else{
        //lock it
        leftDoorTrigger->SetActorEnableCollision(false);
        leftDoor->SetActorEnableCollision(true);
        leftLocked = true;
        print("Left door locked");
    }
}

And .h:

UFUNCTION(BlueprintCallable, Category="Door")
    void toggleLeftDoor();

Both of which are in an actor class. This class has an actor object in the scene (placed, not spawned). I think I am running into problems with how I’m referencing this function in my widget blueprint. Here’s the gist of it, only part not shown is that Toggle Left Door and Toggle Right Door are hooked up to audio, which appears to be working just fine:

80887-screen+shot+2016-03-03+at+5.17.10+pm.png

“Door Logic” here is a blueprint reference to the aforementioned actor object. While I’m not getting any error messages, Toggle Left Door and Toggle Right Door don’t appear to be running. Any thoughts or suggestions?

How do you set “Door Logic”?

It’s a (poorly named) reference to an object of my custom class, containing the door toggle functions. Not sure if that answers your question, sorry…like I said, very new to Unreal. It may be helpful to know that I tried to very similar action with a different widget and got an “Accessed None” error when trying to access this object…

Oh ok… you already know whats wrong but you not aware of that as some tutorial probably confused you, “object reference” is a object pointer (UObject* or whatever UObject class), you need to set it first otherwise it empty ;p also “None” in blueprint = NULL. Lot of things in blueprint works as in C++ so use your knowledge to understand blueprint.

Thank you, that clears it up!