I get several syntax errors for FindObjectsByType

    static GameObject[] players = SceneManager.FindObjectsByType(GameObject PlayerObject);

isn’t working I recieve an error where it goes ??? when locating my PlayerObject prefabs in the scene?

when placed in a method the PlayerObject returns “Game object is a type which is not valid in the given context” which it clearly is? It is loaded in a scene with 4 of these objects in them

Correct that is in no way how to find an object(s) by type

Firstly you dont need to call SceneManager, second, you dont declare the variable type in the parameter like that.

FindObjectsByType is well documented, this isnt it. See Unity - Scripting API: Object.FindObjectsByType (unity3d.com)

1 Like