I personally find it easier to handle transitions with a transition_layer singleton. So, I have a "LevelTransition" CanvasLayer scene with an AnimationPlayer and ColorRect. It's script is autoloaded. The script's only function accepts a target scene as the param. This allows it to unload/load scenes without coupling with any other nodes. This means the main menu can be its own scene independent of the GUI. Here's the function in the singleton: func change_scene(target: String) -> void: self.visible = true $AnimationPlayer.play("transition") await $AnimationPlayer.animation_finished get_tree().change_scene_to_file(target) $AnimationPlayer.play_backwards("transition") self.visible = false I don't know if this is less scalable, or may run into other issues, but it is a bit easier to understand.
I can't believe I missed this comment. Totally workable solution. In fact many people build out entire scene managers to handle various transitions types. My example is a simple approach, but this one would work just as well!
@@GameDevArtisan Kindly do tutorial on state machine and animation tree. There are many tutorials, but I still don't get it. Your tutorials are easy to understand. Thanks in advance.
9:45 this condition is meaningless, if 'get_child(0)' returns not a 'Button' a runtime error will occur. Because there will be an attempt to assign the wrong type to a typed variable. In this case, better to do this: 'var button := buttons_v_box.get_child(0) as Button'. Then if 'get_child(0)' returns not a 'Button' 'as' operator will return 'null'. Then we just check 'button' for 'null'.
This is great feedback! Thanks for pointing this out. You're right, it would be better to use `as`, rather than assume the child is going to be of the type you need when calling `get_child`.
This. As a very beginner myself trying to make a simple main menu to my platformer game, for the first 10 min. everything was ok, and then i'm bombarded by all this mysterious functionalities. I know this is a tutorial series and the video is very well explained(even if i don't understand most of it), but i wish there was a simpler approach to this topic. If anyone have any other recommendations i'll gladly accept it.
This is a really great tutorial i want to keep track of my first few games by making them into like a collection of video games that i can release The first games i want to create will be recreations of older consol games from atari 2600 and the nes but and others i wanted to make them into one large collection could you elaborate on how this could be done
That's not a bad idea. You could have a fun main scene that acts as your entry point, then from there you can swap or transition into the scene for the other type of game you are recreating. You could swap scenes very similar to the way we transition within this video.
I will try your responce when I am off work next and have time to really look at what you're doing so far I have only watch this on my phone and a few areas are a little grey I am hoping it will make more sense when I practice this on my laptop following along ty
Glad you enjoyed. I plan on adding controller support in this series, not sure if I'll do Joystick Control on mobile, but I'll consider a separate video for that!
with the focus, can i choose what key i wish to do what? for example i want select to rotate between my choices, but tab and up and down on the arrow keys to do nothing.
Thank you for going through all of this, it's really useful. I'm building my first game and struggling with the scene architecture (if that's even what you'd call it) - a root Game manager, the UI, world, player, etc. I never thought of instantiating the levels and player on ready. Is this a pretty typical way of doing things? For reference, I'm building a simple platformer. I had a main menu scene on its own that would switch scenes to a game wrapper, which contains world, player, other ui, etc - but this seems like a better solution. Thanks again!
I think its very much personal preference, but I tend to reach for an outer scene that manages a bunch of my game state/scenes and knows how and when to swap vs instance new scenes. Great for UI/Menu transitions etc.
The white is to define the canvas modulate, which by default is full white, which means we want the full value of our canvas, though we modulate it's alpha from 1 to 0 over time.
I personally find it easier to handle transitions with a transition_layer singleton. So, I have a "LevelTransition" CanvasLayer scene with an AnimationPlayer and ColorRect. It's script is autoloaded. The script's only function accepts a target scene as the param. This allows it to unload/load scenes without coupling with any other nodes. This means the main menu can be its own scene independent of the GUI. Here's the function in the singleton:
func change_scene(target: String) -> void:
self.visible = true
$AnimationPlayer.play("transition")
await $AnimationPlayer.animation_finished
get_tree().change_scene_to_file(target)
$AnimationPlayer.play_backwards("transition")
self.visible = false
I don't know if this is less scalable, or may run into other issues, but it is a bit easier to understand.
I can't believe I missed this comment. Totally workable solution. In fact many people build out entire scene managers to handle various transitions types. My example is a simple approach, but this one would work just as well!
Another great video! Thanks for continuing the series and I can’t wait to see more from you.
Thanks! Looking forward to making more videos each week!
Your videos need more attention from Godot Users. They're premium quality. Good job bro.
I appreciate that! Feel free to share and spread the word! Let me know if you there are any topics you think I should cover.
@@GameDevArtisan Kindly do tutorial on state machine and animation tree. There are many tutorials, but I still don't get it. Your tutorials are easy to understand. Thanks in advance.
Yea I think the state machine topic is a good one. Many interpretations of it, and easy to get lost on.
Thank you!
9:45 this condition is meaningless, if 'get_child(0)' returns not a 'Button' a runtime error will occur. Because there will be an attempt to assign the wrong type to a typed variable. In this case, better to do this: 'var button := buttons_v_box.get_child(0) as Button'. Then if 'get_child(0)' returns not a 'Button' 'as' operator will return 'null'. Then we just check 'button' for 'null'.
This is great feedback! Thanks for pointing this out. You're right, it would be better to use `as`, rather than assume the child is going to be of the type you need when calling `get_child`.
10:00 while may not be an issue here it's best practice to use call_deferred when grabbing focus from _ready()
Great point! Thanks for sharing.
I have a question since most beginners wont know how to integrate your script
This. As a very beginner myself trying to make a simple main menu to my platformer game, for the first 10 min. everything was ok, and then i'm bombarded by all this mysterious functionalities.
I know this is a tutorial series and the video is very well explained(even if i don't understand most of it), but i wish there was a simpler approach to this topic. If anyone have any other recommendations i'll gladly accept it.
I wonder if I take a shot each time the word "menu" was spelled this video, how fast do I finish the bottle?
thanks
You bet!
This is a really great tutorial i want to keep track of my first few games by making them into like a collection of video games that i can release The first games i want to create will be recreations of older consol games from atari 2600 and the nes but and others i wanted to make them into one large collection could you elaborate on how this could be done
That's not a bad idea. You could have a fun main scene that acts as your entry point, then from there you can swap or transition into the scene for the other type of game you are recreating. You could swap scenes very similar to the way we transition within this video.
I will try your responce when I am off work next and have time to really look at what you're doing so far I have only watch this on my phone and a few areas are a little grey I am hoping it will make more sense when I practice this on my laptop following along ty
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
Thanks!
Great tutorial❤, for next video can you make a tutorial about how to make joystick controller for mobile??
Glad you enjoyed. I plan on adding controller support in this series, not sure if I'll do Joystick Control on mobile, but I'll consider a separate video for that!
@@GameDevArtisan that would be great, I will looking forward for this one.
with the focus, can i choose what key i wish to do what? for example i want select to rotate between my choices, but tab and up and down on the arrow keys to do nothing.
You can customize all the input actions that are mapped as part of the Project Settings.
Thank you for going through all of this, it's really useful. I'm building my first game and struggling with the scene architecture (if that's even what you'd call it) - a root Game manager, the UI, world, player, etc. I never thought of instantiating the levels and player on ready. Is this a pretty typical way of doing things? For reference, I'm building a simple platformer. I had a main menu scene on its own that would switch scenes to a game wrapper, which contains world, player, other ui, etc - but this seems like a better solution.
Thanks again!
I think its very much personal preference, but I tend to reach for an outer scene that manages a bunch of my game state/scenes and knows how and when to swap vs instance new scenes. Great for UI/Menu transitions etc.
Oh wow I just used prefabs instead of themes.
why do you put white but the transition is black?
The white is to define the canvas modulate, which by default is full white, which means we want the full value of our canvas, though we modulate it's alpha from 1 to 0 over time.