HI all -
So I am trying to randomly generate 2 numbers and have the user enter an answer (sum of them) for a door to open. The generation of numbers works fine and so does the math but which block should I use to read the text property of the object which has the user’s response so I can compare to see if it is correct? Some guidance appreciated.
Link: CoSpaces Edu :: Variables - Version 2
UPDATE: I figured out another way to do it. But would still love to know how to read specific properties from any object on screen. Thanks!
It’s not currently possible to read the text of the text object from CoBlocks, but you can do this in Typescript via the Text3DItem.text property:
let textItem = new Text3DItem();
textItem.text = "hello, world!";
let textItemText = textItem.text;
It’s best practice to set the text with the value of a variable, so usually there is little need to access the text; but if you’re setting it directly, then it’s needed.
Hope that helps! Let me know if you have any further questions. If this solves your problem, please mark this post as the Solution.
Geoff @ TechLeap