Accessed None - Blueprint Target

I’m attempting to change a bool from my character’s blueprint from my player controller. So that when I hold shift the character moves to a run state. The issue is that after figuring out how to target blueprints from my player controller I now get

“Error Accessed None ‘MipTARGET’ from node Construction Script in blueprint MyCharacter”

2093-problem.jpg

Why can’t I gain access to my target blueprint?

What’s that MipTARGET variable? You created it in the blueprint? Are you assigning it some value? You should initialize it in the Construction Script or on the Begin Play event, for example.

Answering your question: exactly what it says, MipTARGET is Null, that variable holds nothing, so it cannot access an IsRunning variable from nothing.

Edit: Oh ok, I see now what you’re trying to do.

What you need is to read the controller’s pawn, then cast it to whatever you called your character blueprint, then change the IsRunning variable. Something like so (on the player controller blueprint):

By the way, input can be handled in the character blueprint too, not necessarily on the player controller. Or even on another blueprint; the Blueprint Door Tutorial (on the wiki) has an example of a door that is opened/closed by user input.

How are you setting MipTARGET? Why not handle the Shift key inside the pawn, rather than in the PC and tell its pawn?

Hey Sythen,

For what you are wanting to do, here is how you would want to reference your Character:

This setup will call the Player Character and Cast it to the custom Character class you are using (I named it MyCharacter in this instance) and from there, you can access any variables or functions you added into your custom Character through the As MyCharacter_C output.

Hope this helps!