Hi there!
If you're reading this, it's because you're at least somewhat interested in seeing if you can help me solve this problem. That makes you an incredibly awesome human being. Thank you! (Seriously, thanks. It's nice of you to take the time.)

Anyway...

I'm using Godot to build SUPER SIMPLE "game" to use at work, during a public speaking exercise inspired by the "table topics" sessions done by toastmasters.

The main button gets the next speaker and topic.

Here's what the main button does:
▫️ Picks a random speaker from the group (that hasn't had a turn yet)
▫️ Picks a topic that hasn't been used yet
▫️ Plays a sound & a fun little particle effect
▫️ then fades in a message showing who was selected and their topic

Works great.

Then there's a little confetti to celebrate

And the speaker and topic are revealed

But I needed it to run on a web browser. So I exported it for the web and upload it to itch.io. Everything seemed to work great there too.
Except for the main button.
Nothing happens when I hit the main button.

The code is simple as you'll see below. I'm not sure what to think.
I've done a fair bit of searching & the closest I can find to people having similar issues boiled down to capitalization errors when referencing a scene change.
That's not what I'm doing.
And I don't have any hard-coded paths or file names.

Here's the function that should fire when the main button's "Pressed" signal fires:

func NewSpeaker() -> void:
	confirm.play()
	
	var hold_up: bool = false
	var tween = null
	
	if control.modulate == Color.html("#ffffff"):
		tween = create_tween()
		tween.tween_property(control, "modulate", Color.html("#ffffff00"), 1)
		hold_up = true
	
	if playersRemaining.size() < 1:
		playersRemaining.clear()
		playersRemaining = Players.data_set.duplicate()
		playersRemaining.shuffle()
			
	if topicsRemaining.size() < 1:
		topicsRemaining.clear()
		topicsRemaining = Topics.data_set.duplicate()
		topicsRemaining.shuffle()
	
	var cur_topic: String = str(topicsRemaining.pop_back()[0])
	var cur_player: String = str(playersRemaining.pop_back()[0])
	
	if hold_up:
		await tween.finished
	
	rollovers.play()	
	YourTurn(cur_topic,cur_player)

note: the hold_up variable checks are there to account for the first time the button is hit and the reveal sounds/FX may not exist to "await".

Once the speaker and topic is selected the YourTurn() function is called to reveal the results on the screen:

func YourTurn(topic: String, speaker: String) -> void:
	speaker_label.text = "CONGRATS " + speaker.to_upper() + " !!"
	topic_label.text = topic
	
	var hold_up: bool = false
	
	drum_roll.play()
	if drum_roll.playing:
		hold_up = true
	if hold_up:
		await drum_roll.finished
	
	ta_da.play()
	party_blast.emitting = true
	
	var tween = create_tween()
	tween.tween_property(control, "modulate", Color.html("#ffffff"), 1)

Again, note: the hold_up variable checks are there to account for the first time the button is hit and the reveal sounds/FX may not exist to "await".

HERE'S WHERE I AM...

I altered the two functions (NewSpeaker & YourTurn) to ALSO change the text of one of the buttons. Just to see if they were firing at all when the web version runs.

The NewSpeaker() function DOES update the button text so I know it's being called.
The YourTurn() function however does NOT update the button text.
So it's either not being called, or failing somewhere.

I suspect the tween, mostly because it's the only place I have something hardcoded (the color values) ... but tweens are working in the first function, so... I dunno.

Maybe the web just doesn't work with the modulate property? But It's what is available to me.


You must log in to comment.