Topic was automatically imported from the old Question2Answer platform.
Asked By
mdswamp
hi godot…
i created an options scene and there is a ability to change color of character’s sprite.
i created a button and connected it to the option’s script and used codes like this:
func _on_Salmon_pressed():
color = "salmon"
then i wrote codes in character’s script like this:
onready var color_options = preload("res://scenes/Menu/Options.tscn").instance().color
if color_options == "salmon":
sprite.set_modulate(Color(98,5,45))
but when i loaded the scene, character’s color didn’t change, what did i do wrong?
What?
How is that comment relevant to your question?
Shouldn’t your if statement be inside of a function?
SIsilicon | 2018-09-26 12:25
hi @SIsilicon
the recent comment is the solution…
mdswamp | 2018-09-26 23:12
Maybe you ought to put it up as an answer instead of a comment.