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.

  • Problem with "Can't I stop the tweens instead of disabling the button?"pikminfan71I didn't understand how to do it, the tween is already inside a variable isn't it? I'd love some help with this, thanks in advance! 2 2 Jun. 01, 2024
  • Shortcut interferenceold-fashioned-jackalI noticed some issues when combining shortcuts with the other forms of input. If my "next" button is in an active state, such as after clicking it, then pressing space or enter will press the button as per the shortcut, then press it again when released. In effect, this means pressing the key skips over a line of dialogue. (Likewise, if my "previous" button for rewinding the dialogue is active, then the result is getting stuck on the same line of dialogue.) It feels like shortcuts are not meant to be used in combination with the usual methods of pressing a button by keyboard or mouse. Should we be disabling other input methods when using shortcuts, or is there a way to make them play nicely together? I also noticed when hovering the cursor on the "next" button, a tooltip pops up saying (Enter(Physical)). This could be useful information, but it looks a bit cluttered/unpolished for a final product (extra parentheses, and the "physical" bit might be confusing or unnecessary to the end user) and it is incomplete (I have three inputs mapped to this action, but only the first is shown). Is there any way to modify this? 5 2 May. 20, 2024
  • Different solution to stopping the tween instead of disabling the buttonrobert_copHi, this seems like a good place to put the solution I came up with, I think I came up with it in the lesson where the text tweening was first introduced. I wanted the button to have a certain behavior, where if you click it while the text is still appearing, it will set the text to fully visible instead of advancing to the next line. This is what I came up with: ```gdscript func advance_dialogue() -> void: if dialogue_label.visible_ratio < 1.0: dialogue_label.visible_ratio = 1.0 dialogue_tween.kill() audio_stream_player.stop() else: current_item_index += 1 if current_item_index >= dialogue_items.size(): current_item_index = 0 slide_in() show_text() ``` ```gdscript func previous_dialogue() -> void: if dialogue_label.visible_ratio < 1.0: dialogue_label.visible_ratio = 1.0 dialogue_tween.kill() audio_stream_player.stop() else: current_item_index -= 1 if current_item_index < 0: current_item_index = dialogue_items.size() - 1 slide_in() show_text() ``` As you can see, instead of checking if there is a tween, it checks if the visible_ratio on the label's text is less than 1.0 (so it checks if the text is still appearing), if this condition is true, it sets the visible_ratio to 1.0, kills the tween, and stops the sound. Else, if the text is already fully visible, it advances to the next line. If anyone was trying to implement something similar, feel free to take notes, I'm pretty happy with how it came out. 1 1 Jul. 31, 2024
  • Two tween signal connectionsliuti_devWhen I tried to add the button disabled code inside the tween finished signal (line 95 *but turned to a lambda function* like at line 102) the button worked as intended but the sound wouldn't stop. It only works separating into two functions. Why does it happen? 4 1 Jun. 13, 2024
  • Using Signals to stop the Tween when Next Button Pressed for the Mini ChallengeiguessfiveEarlier in this module, in the comment section I found a great and simple solution to stopping the text when the next button is pressed. I didn't see it here, so for anyone interested I wrote it below. If anyone wants to try to figure out how to use signals to stop the Tween from playing when the next button is pressed then wait to look below. ```gdscript signal new_text func show_text(): # ... new_text.emit() new_text.connect(tween.stop) ``` 1 0 Sep. 01, 2024
  • What is the difference between using InputEventKey and InputEventAction? Lucas PscheidtWould it work in the same way? 1 0 Aug. 27, 2024
  • Stopping the tweensTJHi! In the info-box about stopping the previous tween, it says: "If the tween is still present, it means text was still appearing when the player advanced the dialogue." I think the tween object can still be there even when it has finished playing. I did some experiment by putting a breakpoint on just the following condition that is recommended by this info-box: ```gdscript if tween != null: tween.kill() # breakpoint here ``` Here, `tween` was first converted to an attribute in the script, moved to the script-scope so it persists between calls to `show_text()`. During debugging, GDScript does break here even after I waited long enough for the current text to have fully appeared and the sound to have stopped. I learn from this that GDScript does not set the attribute `tween` to `null` after the tween has finished. So what remains after a tween has finished is an actual object in memory but it's no longer actively tweening anything. From this experiment, I would propose to use the following condition to guard usage of the `kill()` function: ```gdscript if tween != null and tween.is_running(): tween.kill() ``` What do you think? 2 0 Aug. 16, 2024
  • Function slide_in =/= animateSophiaSliding lessonHazlarJust to point out that the reference code for the slide_in function is not written quite the same way as the one covered in the lesson [https://school.gdquest.com/courses/learn_2d_gamedev_godot_4/telling_a_story/animate_sophia_sliding_in#recap](https://school.gdquest.com/courses/learn_2d_gamedev_godot_4/telling_a_story/animate_sophia_sliding_in#recap) 3 0 Aug. 15, 2024
  • Shortcut button problemAphexI put spacebar and left mouse button on the advance_text input map, when the game is running only the spacebar works. 1 0 Jul. 30, 2024
  • Button VisibilityfledgerI was just curious if you there is any benefit to using disabled instead of visible in this scenario. Would visible just be better for "game juice"? 7 0 Jun. 03, 2024
  • Issue with the pressed theme while using keyboardEddyAs the title say, when I use the spacebar of my keyboard as a shortcut, my next_button does not animate properly. The animation when I use the spacebar is like my "disable_button" (black backgroud and grey letters.). Nevertheless when I check in my main_theme file and when I use the Left-clik of the mouse, it works properly. I tried to find a solution in the Inspector and the main_theme panel but can not find a clue. Is it a display issue or something else I don't undersant? Otherwise it works like a charm. 6 0 May. 26, 2024
Site is in BETA!found a bug?