0 votes

Hi,

I am working on a simple 2D game of Android. It has 3 main scenes: A main menu, a level selection, and the level itself. In the editor the transition between scenes works smoothly. But when i export it to Android, it can only change form main menu to level selection, but not to the level itself.

I have tried using changesceneto, which turned the screen black when a level was selected. So at least i know that the button is working :)

Edit
Answered in the form of a comment, so i can't flag it as the answer

in Engine by (63 points)
edited by

Make sure the casing of the paths to your scenes are correct; Android is case-sensitive, whereas Windows is not. So, if a scene is called This.tscn, loading this.tscn will work on Windows but not on Android.

Good to know..
But i aready checked the scene path a few times, as you might expect in this situation.
However, the scene name has a space, maybe that's the issue. (it's "Tactical Map.scn")

Edit: I now changed the scene to "Tactical_Map.scn".Still the same problem.
I also tried to export as .exe and that doesn't work either.

Edit_2:
Turns out it was exactly that *facepalm* one little node tried to preload a texture i had written in lower case letters, failed, and caused the whole scene to go -> nil
THANKS

1 Answer

+1 vote

hello,

im useing the method change_scene(...). i never heard about change_scene_to(...)

Example:

get_tree().change_scene("res://scenes/WorldMapScreen.tscn")
by (289 points)

Yeah, I also use change_scene()

change_scene_to()

is for already loaded scenes.

Example:

> var sceneToLoad = preload("res://scenes/Scene_To_Load.scn")
> get_tree().change_scene_to(sceneToLoad)

ok thanks but i see your problem was a diffrent issue

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories