Issues with player

Godot Version

4.3

Question

I’m having some issues with my player. I have @onready var camera: Camera3D = $Camera3D and when I play it crashes saying its null.

Here is the player scene. It extends CharacterBody3D.
image

And where I try use it I get a warning stating that it has no shape. Which it does, CapsulShape3D
image

Seems like you aren’t instantiating your player scene but adding a CharacterBody3D node with only the player.gd script attached. ctrl+shift+a will instantiate scenes, you can drag the tscn file from the filesystem into the 3D viewport, or the little chain icon beside the add node button.

This is interesting. Does hitting the + button to add a node only work for native ones and not ones we create?

It can add class named scripts, but it will only add the one node, not a scene. It’s not particularly useful.