Parser Error: Can't preload resource at path: res://Assets/Player/Player.tscn

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rabbitnap

I want to preload the players scene in the players script to respawn the player but it says that it can’t preload the scene

enter image description here

enter image description here

enter image description here

have you double checked the path is correct?

p7f | 2020-08-01 16:32

yes, i dragged it in. it told me, that it is already preloaded what it indeed is, but i want to instance it after it got destroyed with the queue_free command/function to “Respawn” The player scene

Rabbitnap | 2020-08-01 16:37

if Player is name of a class then the variable should be called something else to avoid confision? _player or something. May not apply in this case.

rakkarage | 2020-08-01 17:10

:bust_in_silhouette: Reply From: X


var respawnplayer = get_node(“.”)

:bust_in_silhouette: Reply From: Jumbob-Interactive

I had a similar issue. I don’t think we can preload the same scene that the script is attached to (I’m guessing to avoid getting stuck in a loop). Perhaps have a second scene that handles the respawn and preload that instead, which in turn loads the player.

:bust_in_silhouette: Reply From: Ilja Vost

In my case was the same error. The problem was in custom resource with several “PackedScene”. This resource was connected to Player export slot.

Code example from my custom resource:

export(PackedScene) var inventory
export(PackedScene) var buy_menu

I solved it by changing “PackedScene” to “String, FILE” and the error disappeared. Maybe your case connected with this type of export.