Godot Version
v4.3
Question
Hello! This is my first time posting here so I apologize if I don't explain it well enough.
I am working on making a visual novel in Godot and when the player is given choices to select, instances of a button scene I made will be created and then added as children to the container node.
Here is the parent scene:
Within the ScrollContainer Node, there is a grid container that is another scene called ChoiceSelector:
And finally, the ChoiceButton scene:
This is the script attached to ChoiceSelector where ChoiceButton is instantiated
class_name ChoiceSelector
extends GridContainer
signal choice_made(target_id)
const CHOICE_BUTTON := preload('res://ChoiceButton.tscn')
func display(_decision: Decision) -> void:
var numberOfOptions = 0
for option in _decision.options:
if ScenePlayer.choice_dictionary.has(option):
if !PlayerStats.selectedChoices.has(option):
numberOfOptions += 1
var choiceInformation = ScenePlayer.choice_dictionary[option]
var button = CHOICE_BUTTON.instantiate()
button.new_choice_button(choiceInformation)
button.choice_button_pressed.connect(_on_Button_pressed)
add_child(button)
func _clear() -> void:
for child in get_children():
child.queue_free()
func _on_Button_pressed(target_id: String) -> void:
_clear()
choice_made.emit(target_id)
When playing the game, it looks like this:
And there is no way to scroll to show the fifth option.
I have tried various combinations of clicking Expand in the Container Sizing but so far, I haven’t found a combination that works for what I need to accomplish. Another thing to note is that if I manually add ChoiceButton nodes into ChoiceSelector, I will be able to scroll with the scrollbar.
Any insight is very much appreciated ![]()



