Looks like you're not logged in

Login or Register to continue

Lesson Q&A

Use this space for questions related to what you're learning. For any other type of support (website, learning platform, payments, etc...) please get in touch using the contact form.

  • Camera movementOzardUntil this module I had the camera as a child of the Runner in the game scene, so the CanvasLayer was not centered on the camera. Looking back into this module previous lesosns I found that the camera must be placed inside the runner scene, so I did that. This made me think about what would happend If I had two players each having it's own camera. So I tried it, I guess the game gets the first camera in order (top to bottom). Is adding the camera to the player a common practice? Are there better ways to handle the camera overlay? I'm super new to game programmig, will we dive into this camera stuff later on the course? 1 1 Jan. 14, 2025
  • Weird offset pivot bug for text in CountDown sceneBen HolnessHey there, returning from a future lesson but I noticed that my CountDown scene for the numbers 3, 2 and 1, the scale animation appears to be coming from the left and not the centre for the label. It seems the GO! text is fine as it scales down from the center (see my attached Loom video of this in action: [https://www.loom.com/share/2fda7e3f807a4cf094b72d07e897d8a2?sid=4e6e8b2c-96c2-49e2-b80f-7d4154099572)](https://www.loom.com/share/2fda7e3f807a4cf094b72d07e897d8a2?sid=4e6e8b2c-96c2-49e2-b80f-7d4154099572)). I did a bit of digging and in the CountDown script, and I see that it does appear to be using get_combined_minimum_size() and the dividing it by to to get a central point for the pivot_offset, but it doesn't appear to be working with first three numbers. ```gdscript # Every time the text changes, the label's size changes too. For # small, one letter texts, the effect isn't noticeable, but for longer # strings, the difference could be felt. # For proper scaling from the center, we ensure the pivot is in the # middle. We recalculate this after each step pivot_offset = get_combined_minimum_size() / 2.0 ``` I haven't touched the script and the CountDown scene's anchor preset is set to center in the CanvasLayer. Appreciate any thoughts on why this is happening. 5 0 Jun. 07, 2025
  • Formatting PreferencesLewlewI know this is just personal preference but I had a bit of a hard time wrapping my head around that the count down start and finish were not needing to be wrapped up in their own function and then called from the _ready function. So I made a few changes to move everything from the _ready function into their own functions that make it easier for me personally to understand what is happening. Included below incase it is useful to anyone else. ```gdscript extends Node2D @onready var _finish_line: FinishLine = %FinishLine @onready var _runner: Runner = %Runner @onready var _count_down: CountDown = %CountDown func _ready() -> void: get_ready() finish_line_crossed() func get_ready() -> void: _count_down.start_counting() _runner.set_physics_process(false) _count_down.counting_finished.connect( func() -> void: _runner.set_physics_process(true) ) func finish_line_crossed () -> void: _finish_line.body_entered.connect(func (body: Node) -> void: if body is not Runner: return var runner := body as Runner runner.set_physics_process(false) var destination_position := ( _finish_line.global_position + Vector2(0, 64) ) runner.walk_to(destination_position) runner.walked_to.connect( _finish_line.pop_confettis ) ) _finish_line.confettis_finished.connect( get_tree().reload_current_scene ) ``` 1 0 May. 25, 2025
  • Is it good practise to create functions separate from _ready()?BONDEGGHi, I've noticed that the _ready() function has a tendency to get quite busy and therefore (for me personally maybe) quite hard to read and follow. In this case, is it good practise, or will anything bad happen if I created separate functions and just called them in _ready()? For example, this lesson I moved the *_finish_line.body_entered.connect* code to a separate function, poorly named *connect_finish_line_body_entered()* and then just called that in _ready(). All seemed to work in this particular case, but is there a reason to not do this? It seems to make it a lot more readable and easy to follow for me at least! ```gdscript # .. func _ready() -> void: # .. connect_finish_line_body_entered() # .. func connect_finish_line_body_entered() -> void: _finish_line.body_entered.connect(func (body: Node) -> void: if body is not Runner: return var runner := body as Runner runner.set_physics_process(false) var destination_position := ( _finish_line.global_position + Vector2(0, 64) ) runner.walk_to(destination_position) runner.walked_to.connect(_finish_line.pop_confettis) ) ``` Thank you :) 4 0 Apr. 02, 2025
  • I very much enjoyed this lessonilliterate-spiderI learned that most likely with game character inventories when you open it up it uses a canvasLayer or should use one. 1 0 Mar. 16, 2025
  • Why are control nodes not ideal as the root node in UI-based games?SingleMom420In this lesson, you wrote: > This often leads people who don't know about CanvasLayer to use a Control node as the root node of their game, which isn't the most appropriate. If one were to make an entirely UI-based game, like an incremental clicker game, for example, why would it not be ideal to have the root node a control node? Assuming the game only uses control nodes. 1 0 Feb. 01, 2025
  • Can I use 'await' instead of connecting signals?DMKI just thought they were more intuitive and allows the code to be 'read like a book', but no one seems to use them in production. Why? 2 0 Jan. 08, 2025
  • The scene running side panel is grayhumble-pelicanHello, after adding the canvas layer, the side of the runtime scene background will have a gray range, is this normal?How to deal with it? This is image links https://imgur.com/a/45mmgdy,Thank You 2 0 Dec. 06, 2024
  • The text is not centeredPixAngelHellow there, Is it normal the text appear with a little gap from the left? 7 0 Nov. 26, 2024
Site is in BETA!found a bug?