Trying to assign value of type 'PackedScene' to a variable of type 'Node'

Godot Version

I’m using Godot v4.7.1

Question

I’m following this tutorial by Letta Corporation and even though I followed every instruction, an error still pops up at line 8. I’m not sure why and I was hoping I could get some insight and help on the issue! (I am an absolute beginner btw, so please excuse me if I come across as clueless)

extends Node2D

@export var platforms: Array[PackedScene]

@onready var marker: Marker2D = $Marker2D

func _on_timer_timeout() -> void:
	var random_platform: Node = platforms.pick_random()
	var random_platform_instance: Node = random_platform.instantiate()
	add_child(random_platform_instance)
	
	random_platform_instance.position = marker.position
	

Show the error that appears at line 8.

The error is

Trying to assign value of type ‘PackedScene’ to a variable of type ‘Node’

on the line

var random_platform: Node = platforms.pick_random()

Change it to:

var random_platform:PackedScene = platforms.pick_random()

You hardcoded the variable type to Node so it couldn’t store a PackedScene .