Quantcast
Channel: Answers for "InvalidCastException when trying to access child components"
Browsing all 4 articles
Browse latest View live

Answer by senad

I do not see anything wrong in that code. Maybe you can look at what GetComponentsInChildren() returns in debug mode to get a hint at the problem. For this purpose you can change the type of...

View Article



Answer by willgoldstone

Hi there, I cover how to correct this bug in my errata pages for the book, see the workaround there, but Senad is correct in his / her assumption that casting to generic Component solves the issue, see...

View Article

Answer by senad

I do not see anything wrong in that code. Maybe you can look at what GetComponentsInChildren() returns in debug mode to get a hint at the problem. For this purpose you can change the type of...

View Article

Answer by willgoldstone

Hi there, I cover how to correct this bug in my errata pages for the book, see the workaround there, but Senad is correct in his / her assumption that casting to generic Component solves the issue, see...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images