How to access Camera3d that is child of Node3d in c#

Hello all ,
I trying to get access to Camera3D which its path is :
CharacterBody3DPlayer/Head/Camera3D
Trying to do :

private Camera3D camera3D;


  public override void _Ready()
  {
	camera3D = GetNode<Camera3D>("Camera3D");
  }

But the camera3D is null
What im doing wrong ?

In order for that code to work it needs to be placed on Head node.

If the script you provided is instead attached to CharacterBody3DPlayer node, then it need to be this:

camera3D = GetNode<Camera3D>("Head/Camera3D");
1 Like