![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | retsi3602 |
Hey im making an eductaional game that asks questions and am trying to change the question to the next question based on the text that is inside the RichTextLabel. Im using this rn but it doesn’t do anything???
var question1 = “What are the objectives of Financial Management?”
var question2 = “Placeholder”
func questionupdater():
if getnode(“Question”).text == question1:
getnode(“Question”).text = (str(question_2))
This is attached to a signal when a line edit node has text entered into it, but it just stays as the 1st question.
Your variable is called question2
(without an underscore), but when setting the text you’re using question_2
(with an underscore). That should result in an error though! Have you made sure the initial text of your “Question”-node is exactly (even a trailing whitespace will result in a difference) identical to the value of question1
? Have you ensured that questionupdater
is properly called (either by printing some text at the beginning or setting a breakpoint in the editor)? Otherwise it looks fine.
njamster | 2020-06-21 12:13