Blueprint Error While Trying To Set Up Player Inputs

I’m trying to make the ability to look around using the mouse but also have the ability to change the speed. I made a blueprint called input_handler that holds the data telling what the rate for vertical and horizontal movement for the controller and mouse. However, when I try referencing the blueprint to get the rates when the input axis event is called, nothing happens and I get an error after gameplay. This is the error I get:

Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item from function: 'ExecuteUbergraph_MainCharacterBase' from node: Add Controller Pitch Input in graph: EventGraph in object: MainCharacterBase with description: Accessed None trying to read property CallFunc_Array_Get_Item

Here are screenshots of both classes:

That error means that the array you’re returning from ‘Get Actors Of Class’ is empty, most probably because the InputHander class you created doesn’t exist within the world.

I would consider re-writing your input handler so that it’s an Actor Component which you can then easily attach to all actors which need it. This will also be a performance improvement as I imagine Get Actors Of Class could be quite expensive.

Alternately you could put all the functionality within your Character class / blueprint itself, but that becomes less re-usable.

There are other solutions, but I think those are the best ways without knowing more about your project.