Hello!
Im trying to do something very simple, there are 3 squares each of them changes the value of the numbers you can see there (the three 0s will change when you hit the box with the stick) now theres a widget there that will randomly generate a simple math question and the idea is that for example you get 2+2 on the first question that would mean that the first key code or the first digit of the code would be 4. Im trying to compare these numbers but Im having issues with casting the answer to the widget (I just started to learn this and it has been fun but casting is always winning over me).
This is how it looks visuallly
This is how I compare the results basically the Answer will not compare with the actual value of the number in the code, if the answer is 4 then 4 will compare with the current number in the slot of the code, do I make sense ?
Before all that it comes to this:
I first update the canvas widget with random operations, there are 3 texts in my widget called level 1 widget and first I do 2 random numbers one from 0 to 5 and then the other one to 4 so it doesnt reach to 10, after all that I do an append to send it to the widget so it updates the info .
Then:
I do an addition between the 2 random numbers of each piece of text and store them in separate values such as Answer1,2,3. Those answers are needed on my custom event called compare results so I can check those answers with the numbers in the slot.
Now the thing is in the CAST TO INSERT_CODE_WIDGET doesnt matter what I add to the object I always get a ■■■■ error or warning or maybe not even error or warnings but it just doesnt go through… and then it never compares and works any help would be appreciate it.
This was my final attempt, no errors after compile but doesnt work or go through: