Hi all, working on trying to get a camera reference working from. my player scene
I have ths in my player script:
@export_node_path("Camera2D") var camera: NodePath
var remote_camera: RemoteTransform2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
assert(camera != null, "No Camera Assigned.")
print(camera)
remote_camera.remote_path = camera
i keep getting an error on the last line,
Invalid assignment of property or key 'remote_path' with value of type 'NodePath' on base object of type 'Nil'
I want to have the player in the main scene be able to reference the Game Camera to allow for camera movement to follow the player. I had a RemoteTransform2D when the player was just set as a node in the main scene but since separating it into its own scene, i cant figure out how to do this reference.
I tried doing a web search but I can't get it specific enough for my use case.
Anyy and all help is much appreciated!