Added: 1 year ago
From: infiniteammoinc
Views: 13,923
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (45)

Sign In or Sign Up now to post a comment!
  • Tutorial N2 min 3.26 --- Menu Items Option( under menu manager ) is not there in my unity i have Unity 3.5.0 ---- > Help me please.

  • Help!

    I ever seen Size MenuItem..why?

  • ok nevermind got it

  • After doing all of the code and such all of my menu items still move even when i change the value of currentMenuItem

  • I get :"NullReferenceException: Object reference not set to an instance of an object" on "menuItems[currentMenuItem].On­Selected(true);"

    I also noticed that I don't see the 3 elements in MenuManager.

    Can someone please tell me how I can fix this?

    Another question:Here we create an array for the type MenuItem "var menuItems:MenuItem[];"

    I see the name MenuItem on many places. Where is the type defined?

  • I have a problem with this MenuManger script. I only get the Current Menu Item showing but not the Menu Items. Can you help?

  • damnit... "Too Many Root Sets" WTF !!!!! Man i suck so bad at this shit lol.. now my program is frozen ... GRRRR

  • Can this work w/ GUI texts?

  • buttons go back into place code here: (ps i changed names like @LRMANIA said. MenuManagerScript var menuItems : menuItem[]; var currentmenueItem : int = 0; var keyDelay : float = 0.25; function Start() { menuItems[currentmenueItem].On­Select(true);var lastMenuItem:int = currentmenueItem; ______________________________­__________________________ function OnSelect (on : boolean){ if (on) {iTween.MoveTo (gameObject,{"z": -1, "time":0.5});} else {iTween.MoveTo (gameObject,{"z": 0, "time":0.5}); }}
  • buttons go back into place code here: (ps i changed names like @LRMANIA said. MenuManagerScript var menuItems : menuItem[]; var currentmenueItem : int = 0; var keyDelay : float = 0.25; function Start() { menuItems[currentmenueItem].On­Select(true);var lastMenuItem:int = currentmenueItem; ______________________________­__________________________ function OnSelect (on : boolean){ if (on) {iTween.MoveTo (gameObject,{"z": -1, "time":0.5});} else {iTween.MoveTo (gameObject,{"z": 0, "time":0.5}); }}
  • HOW DO YOU KNOW ALL OF THIS!

  • @RespawnIV Mostly likely you've made a minor typo somewhere. If you're missing a semicolon or have a bracket in the wrong place, the compiler will get confused. :)

  • i had to make sure i capitalized everything as infinite had. One error i also had was i added a extra 's' to MenuItem. Once i changed it to var menuItems:MenuItem; i was able to get the array. Now i have a does not support slicing error on the menuItems[currentMenuItem].OnS­elected(true); part

  • Comment removed

  • Comment removed

  • hey i have errors

    Assets / MainMenu / MenuItem.js (18.17): BCE0004: Ambiguous reference 'iTween': iTween, iTween.

    Assets / MainMenu / MenuItem.js (22:17): BCE0004: Ambiguous reference 'iTween': iTween, iTween.

    Assets / MainMenu / MenuManager.js (14.75): BCE0053: Property 'UnityScript.Lang.Extensions.l­ength' is read only.

  • it compiles properly without a single bug but the menu buttons still do not show in the inspector at all

  • For some reason it won't let me set the menu buttons as elements in the menu manager, I really don't get it. It seems to think that the only object in my scene is the floor, when I quite clearly have the menu item objects in there.

    Any suggestions on what to do?

  • You said "I'm making this up as I go along."

    Mr Wingit.

    What a fantastic way to teach.

  • WTF?!

    Do you find yourself already talking out loud to nobody in particular when you wake up in the morning?

    You're all over the place.

    If your code matches your style of presentation then it would be worse than Spaghetti Junction.

    Meatballs for brains and a mouthful of marbles.

    Are these tutorials (for want of a better word) aimed at novices, rocket scientists, Mac fanboys or just no-one?

    Think before you open your mouth.

    Your self conscious sniggering says it all.

  • I tried EVERYTHING here.. Nothin, but NOTHING works... Can someone tell me, in the script menumanager, in first line (visible at 3:10 in this video), says:

    "var menuItems:MenuItem[];" (without quotes). Now, is this "var NameOfThePrefab:NameOfTheScrip­t[]" or vice versa?

  • since I am just starting to learn to work with unity, this tutorial was very helpful, despite the fact that it does not work no matter what i am trying to do.

    The array of MenuItems is not picked up by the inspector.

    tryed all the suggestions above, still no success :(

  • @Salafer1401 when i use GameObject for the array of the meu items it does let me populate the array but then OnSelected is apparently not a mamber of unityEngine.GameObject :(

  • @infiniteammoinc i Finally managed to fix it. Sorry for bothering u. ignore the last comment XD. btw, Thank you for your tutorials. Really helpful to me and a lot of people. Good job

  • @infiniteammoinc i keep getting the BCE0019: 'OnSelected' is not a member of 'UnityEditor.MenuItem'. Ive tried to resolve the problem but i couldnt. if you could plz help

  • I'm having the same problem as LRMANIA, there is an error showing up about iTween

    "NullReferenceException: Object reference not set to an instance of an object

    iTween.LateUpdate () (at Assets/Plugins/iTween.cs:6453)­"

    Any idea if that could be the problem? If so, HOW DO I FIX IT!!!

  • I can't get menu manager script working. it doesn't show like yours and i type word for word. help please :)

  • hey couldnt you just have used getbuttondown instead of getaxis ??

  • FYI - In Unity v3, You would need to create a folder named "Plugins" in your assets folder and install iTween there in order for you to use iTween.

  • message to infiniteteammoinc :

    var MenuItems : MenuItem[];

    for some reason the array thing doesnt appear when i click the menumanager object.please fu*king tell us how to fix it.

    thank you

  • @LRMANIA Do you have errors showing up in the console?

    If your scripts don't compile properly, you'll get errors, and the script won't update the gui.

  • @infiniteammoinc

    there are no errors.BUT it still doesnt work

    BTW thank you for replying

  • @infiniteammoinc I've got the same error. The only fix that I've discovered is to instead of using MenuItem[]; I had to use GameObject[]; and when calling the OnSelected function I use menuItem[currentMenuItem].GetC­omponent("MenuItem").OnSelecte­d(true);

    There's no error recorded, but it does show the array. Let me know if you find a different fix.

    I noticed that you're using a MAC, and I'm on a PC (Windows XP) using Notepad++ as the editor.

  • @infiniteammoinc no errors, compiles and still no sign of the array var

  • @LRMANIA It's fu*king awesome bug I ever seen... Is your "MenuItem" (Prefab) and "MenuItem" (Script) have same name? Rename the script to "menuItem".

    And "var MenuItems:MenuItem[];" to "var MenuItems:menuItem[];" This help me.

  • @2048Terrabit

    THANKS!!!il see if that works after i have cured from the cold.thanks again!

  • @2048Terrabit Thanks! I was trying to figure out wtf was going on with this tutorial and me not being able to follow along after this point.

    And yea wtf its some kinda bug with the naming in unity v3 cause I started to find that people were starting to have to name their menu's something other than a menu lol

    Again thanks for that post got a thumbs up from me :)

  • @2048Terrabit thanks

  • @2048Terrabit : genious thx:D. I spent more than an hour trying to fix this :S

  • @FunkyFrog14 Same. Maybe somebody could help and tell us what to do? You know what, screw it, i'll figure it out then post asap.

  • it gives me this error

    The name 'MenuItem' does not denote a valid type.

    can you help me pls

  • For those shorthand "if" statements, are the yeilds inside the brackets if I'm writing them out longer?

  • thanks for your tutorials.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more