I’m trying to get the reference to the Player Camera Manager for a line trace I’ve created in a component that is a child of the Player Character. It works for the server but it doesn’t for the client.
I get the following error: “Blueprint Runtime Error: “Accessed None trying to read property PlayerCameraRef”. Node: Line Trace By Channel Graph: EventGraph Function: Execute Ubergraph BPC Look At Blueprint: BPC_LookAt”
first of all, the camera is probably in the character, not in the player controller, get the actor that contains the camera, once you know which actor contains that camera, cast to that actor directly, no need to cast to multiple actors (depends on the parent hierarchy), if it belongs to a diferent parent maybe try Get Actor of Class, let me know if i helped you.
Thank you, that’s a very good point! I cast directly to the player character instead and now I don’t get the error anymore! In my case this is how it looks:
yes thats perfect, i would even change, the get owner node to the Get Player Character node, as it looks like its your main character, owner if im not wrong will get a reference to the playercontroller, but im not sure