GDSCript error in Loony Lips

I’m in the Story Objects lesson of Loony Lips in the Godot course, and I’m running into an error when using the code from the video. The code in question is this:

func set_current_story():
	randomize()
	var stories = $Storybook.get_child_count()
	var selected_story = randi() % stories
	current_story.prompts = $Storybook.get_child((selected_story).prompts

and the issue is with the last line. The error is "Expected ‘,’ or ‘)’ ", but I can’t see where a comma or a parentheses would be needed. I’ve made sure to trim the whitespace and have tried typing, retyping, cut and pasting it, etc, but no dice so far. Any help would be much appreciated. Thanks!

morning,

looks like you have an extra opening bracket just after the .get_child
$Storybook.get_child((selected_story)
to
$Storybook.get_child(selected_story)

1 Like

ohh, of course it was something silly like that. Thank you!!

1 Like

no bother at all, any time.
glad your back on track :slight_smile:

if you can mark it as solved too please, that would be great :wink:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms