- Home /
Question by
CrispyDev · Jan 03, 2018 at 05:45 AM ·
c#object referencequests
UnityEngine.object Error
This example is in C# Error:
error CS0039: Cannot convert type UnityEngine.Object' to
QuestObject[]' via a built-in conversion.
I'm trying to find all of the quest objects to update their status. I do not understand why this isn't working as the object is being typecast. Is there a way around this?
QuestObject[] currentQuestObjects = FindObjectOfType(typeof(QuestObject)) as QuestObject[];
Comment
Best Answer
Answer by Lysander · Jan 03, 2018 at 05:47 AM
Missing an "s" there- it should be FindObjectsOfType to return a collection- this is only returning a single result, so there's no built-in way to convert it to a collection.
Your answer
![](https://koobas.hobune.stream/wayback/20220612145717im_/https://answers.unity.com/themes/thub/images/avi.jpg)