Hello coders and devs,
How would I go about getting an array (let’s call it ‘items’) and putting it into one string (let’s call it ‘allitems’)? I’ve currently got this script:
for (var i = 0; i < items.length; i++){
item = items*;*
allitems = (“” + item.transform.position.x).toString();
print (allitems);
}
I’m currently getting the Missing Method Exception: System.String.toString Error
I want to put the transform.position.x of each item onto a string so it outputs to something like this:
32 55 60 43 405
or another example:
43 9 321 64 34 7 10 29 1 945 58 77
(They are exact integers and sorting doesn’t matter)
Thanks, I appreciate your feedback and answers!