Accessed None Trying to read Property CameraPawnRef

Hi everyone.
I begin to follow a tutorial for create a 3/4 camera but I have a problem, and I don’t know why. When I launch the game on UE4 and I try move the camera nothing happens, and when I stop the simulation he says “Accessed None Trying to read Property CameraPawnRef” from node SetActorTransform.

It’s the event graph which have a problem just on Transform node

Thank you for your solution

Is that the RTS tutorial from youtube? where do you set the “CameraPawnRef” variable? What is in “Reference casts”?

It means you never set what your Camera Pawn Ref is. Somewhere in begin play make sure you set what the CameraPawnRef actually is, because right now it is set to nothing, meaning it has no idea what to work with.

Also turn your ‘Movement Speed Calculation’ function to a pure function, or connect the white wire. Without either of these two steps, you will always get a 0 as your Axis Value.

I just saw that my first post work, when I try to post I was an error.
For this error, I find why I was that, that was an error on project setting. But I will try your solution cause for the moment nothing move.

And yes, it’s this tutorial.

ok, with the right setting on project, and with pure function that work thank you for your help

Hi, I’m having this same problem. How did you end up fixing it? What was the “right setting on project”?

EDIT - Got it fixed. I had to change the parent base class in myGameMode and myGameState.

I am having this problem as well. I’m pretty sure I followed the tutorial, and people keep talking about GameMode/GameState. I’ve switched those options in every combination possible, but nothing’s working. I just don’t understand what’s going on.

Edit: Never mind, I apparently had crossed some wires, and other wires had fallen out.

i have the same problem…anyone can help me?

Ok, none of the above helped me.

I don’t know yet why this helps because in the output log after attaching Prints everything logs in correct order.

So to get rid of the errors I’ve added bool variable IsGameInitialized which Set node is executed after Setting CameraPawnRef in BeginPlay, and then added for input nodes additional Branch node for them to execute only when variable IsGameInitialized is true (which runs before any other input and scrolling logic).

I don’t know but maybe that input nodes are enabled just at the start of begin play and runs on the other thread and actualy could run before BeginPlay executes the Set CameraPawnRef. Thats one possibility.

Anyway adding this varianle and checking it before inputs nodes are processed got rid of the “Accessed None trying to read property CameraPawnRef” error

That means you have a bad reference. Share your log and your blueprint and perhaps we could be of more help.

I was following this tutorial RTS Tutorial Camera Movement - Unreal Engine 4 - YouTube . And it works in the editor but there are errors visible in output and message log, so the built game cannot be played as package until those errors are solved.

I am using UE 4.27.2-18319896+++UE4+Release-4.27

Try this: Quick Dev Tip #57 UE4 / UE5 - Breakpoint On Error - YouTube

Is it still playable?

1 Like

Thanks for the link - pretty useful.

But game still breaks inside Tick event on the graph because reference is not set. Im setting references in the Sequence node in the BeginPlay event. Tonight I will try to post clean example of this error maybe on github or something, because I’ve made some changes after my workaround.

Ok it turns out it works when playing as Standalone, and error occurs when playing with two players and in “Play as Listen Server”.


Probably the macro sets the CameraRef only for one player and error occurs for the other player (different player index)