Hi thar, I’m kinda new to Unity (meaning I’ve been playing around on it for a few days) and I’m working on a carousel style main menu using 3D gui components with custom shaders and raycasting yadda yadda. And I’m really happy how its turned out but I’ve run into a problem when creating class objects for the menu items to store and manage height and movement.
When I debug it there’s a problem with the constructor for the menu item not accepting the variable types or rather its not detecting any constructors that match the input types, which I am pretty sure do match. Here is my code for the constructor and the call to it:
Constructor:
public function MenuItem(Item : GameObject, List : Array) {
this.Item = Item;
this.SubItems = List;
this.ItemStatus = false;
this.Height = List.length * 1;
this.Alpha = 0f;
}
Call to constructor:
Items[0] = new MenuItem(MenuObjects[0].Find("Play"), [MenuObjects[0].Find("Continue")]);
I am a bit new to coding in unity, so some of my code may seem sloppy (I would appreciate tips on fixing that too :)) but other than this damned constructor and data types I’m not having to much difficulty.
I would greatly appreciate any help in resolving this issue