Error Trying to Loop Through Array
Hi,
Anyone know why I'm getting an error in my script?
Bringing in my SceneObject as an array and trying to loop through it.
//@input SceneObject[] T
function showTitles(){
for(var i = 0; i < script.T.length; i++){
script.T[i].enabled = true;
} }
I'm getting an error message -
08:32:40.922 [Scenarium] TypeError: cannot read property 'length' of undefined
at showTitles (Scripts/Elli Script.js:40)
at [anon] (Scripts/Elli Script.js:27) preventsyield
Does anyone know why?
It looks like you did not assign objects to the array T. Make sure you selected objects for the "T" property on the script component in the Inspector panel.