int objecCount = FindObjectOfType().Length;
The line shows me error as gameSpeed Does not contain a definition of length. I want to find the no. of gameSpeed objects created.
But in Rick’s video it’s the line is working fine. How?
int objecCount = FindObjectOfType().Length;
The line shows me error as gameSpeed Does not contain a definition of length. I want to find the no. of gameSpeed objects created.
But in Rick’s video it’s the line is working fine. How?
Hi Allan,
Check the spelling of the method. Can you spot the difference? Remember you can also look at the lecture code changes via the link in the Resources of each lecture.
I’VE TRIED CHEKING THE SPELLING . i’VE USED BOTH SMALL L AND CAPITAL L BUT NO USE.
THE ONLY DIFFERENCE IS I’M USING UNITY 2019 WHILE RICK IS USING UNITY 2018. mAY BE IT’S THE VERSION PROBLEM…I THINK
The method you need is FindObjectsOfType, with an s.
See also:
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.