Player NOT in the main scene AFTER exporting

What’s in what code? The loading screen’s script? I’ve already shared that . It is the script which tries to load the main scene. Also I did format the code and it looked just right on PC but not on phone smh

Ok. It’s hard to keep straight when I do not have access to your project. I’m not sure what’s up with the formatting then. On my computer it looked very odd.

So knowing that and going back through the first error, it seems that character_body_2d.tscn cannot load a dependency which is the main_menu.gd file because it cannot load res://scenes/loading_screen.tscn. Looking really closely at your code, it appear that instead of quotes, you are surrounding your filename with smart quotes:

These are not recognized by the GDScript interpreter, and I believe are the source of your problem.

So replace this:

“res://scenes/loading_screen.tscn”

With this:

"res://scenes/loading_screen.tscn"

And they should work.

This is yet another reason to use a drag-and-drop reference to your files when loading them and use the resultant variable in your script.

This problem probably occurred one of a few ways:

  1. You copy and pasted your string (with quotes) into and out of Microsoft Word or or another program that automatically creates smart quotes.
  2. You copied that string from an LLM that formatted the line with smart quotes and pasted it into GDScript.
  3. Maybe (and I’m just guessing here) if you are using the Android version of Godot on your phone or tablet to make a game, it’s potentially doing it somehow.

NOTE: They were also used in your "new animation" string.

1 Like

In my scripts , both quotes appear to be the same but still I tried using straight ones but again it did nothing . I found this post by some other user who had a similar problem(or idk the same as mine?) and their problem got solved but i cant understand what the person is saying in the solved reply:

If you want to stick your project up on GitHub temporarily I can take a look. But I don’t think at this point I can help you debug any farther without seeing the project.

I sent an invite

So I grabbed your project and loaded it up on Windows. Then I tried to run it in the editor to get a baseline for the export. I got 50 errors and warnings in the console.


I fixed 35 warnings and got it down to 15.

I then tried to open main.tscn and got a missing dependency.

I cannot find any reference to that file anywhere in the project. Do you know how it’s attached to the character_body_2d scene? Is it missing or deleted?

I pushed all the fixes I made into a fixes branch for you.

Seems like OP’s project is corrupted.

No, I don’t think so. I believe this is a case of cascading dependency errors. I think that this file was deleted from the project with the assumption it is no longer being used. But I don’t know what it was used in, and there’s a lot of AnimatedSprite2D and Sprite2D nodes in the player.

I don’t even know what sprite that is every sprite that I have used has a name

1 Like

I added told it to use the godot icon, and it appears to be the tilemap for the breath AnimatedSprite2D

I then closed the project, ran a git restore on the scene, and then fixed it to point at breath.png.

That got the game to run. I played it for a minute and 13 seconds, and it generated 11,597 errors.

However it plays, and I was able to export a Windows version that also appears to work. I have pushed the fix to the fixes branch.

Ultimately, this was just a broken texture reference in character_body_2d.tscn. (Though hardcoded absolute paths with drive letters also would have been a problem.)

1 Like

11000 is nothing I got 15000 errors once lol . Welp at least I made a very first project on my own I don’t even have a decent experience with godot . Thanks for giving your time on this stupid side project which I might never touch again. I just wanted to solve this issue just in case I encounter it again while working on a more important project

1 Like

On the next project I recommend you fix errors as they appear. That way you won’t end up down this road again.

I recommend you put it up on itch.io for free if nothing else. It’ll help you see how far you’ve come in the future, but it’s also a pretty good looking game. Players can’t see the errors, and you put a lot of effort into it.

2 Likes

Great advice , I’ll try to fix errors as they appear next time

1 Like