I've run into a bit of trouble passing an array of transform objects to a constructor. It seems the way I've set it up its passing the correct array just empty and thats causing trouble further down the line. So here's the call to the constructor with the parameters:
items = new MenuItem(menuObjects.Find("Multiplayer"), [menuObjects.Find("Create"), menuObjects.Find("Join"), menuObjects.Find("QuickMatch")], 2);
The specific part that I believe is giving the trouble is the [menuObjects.Find("Create"), menuObjects.Find("Join"), menuObjects.Find("QuickMatch")] bit which is returning UnityEngine.Transform. I am honestly stumped, and I've tried a google search to find out a fix but I can't find a suitable alternative short of creating a variable and then storing them in there then passing them.
If anyone could help me it would be much appreciated.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
2 People are following this question.
How to Spawn one object at a time in Transform Array
have array target person of most priority/stick with top prior
List and store vector3 of game objects with tag
Constructor in array of classes? [SOLVED]
How can I convert an object array into a transform array?