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].OnSelect(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].OnSelect(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].OnSelect(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].OnSelect(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].OnSelect(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}); }}
@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].OnSelected(true); part
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.
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:NameOfTheScript[]" 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
@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].GetComponent("MenuItem").OnSelected(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.
@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 :)
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.
mestizosuomi 3 days ago
Help!
I ever seen Size MenuItem..why?
XN4k3D 1 week ago
ok nevermind got it
MrDiablo5222 1 month ago
After doing all of the code and such all of my menu items still move even when i change the value of currentMenuItem
MrDiablo5222 1 month ago
I get :"NullReferenceException: Object reference not set to an instance of an object" on "menuItems[currentMenuItem].OnSelected(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?
MrFinnfemfel 1 month ago
I have a problem with this MenuManger script. I only get the Current Menu Item showing but not the Menu Items. Can you help?
RonWemel98 2 months ago
damnit... "Too Many Root Sets" WTF !!!!! Man i suck so bad at this shit lol.. now my program is frozen ... GRRRR
CHETACHEEZSQR 3 months ago
Can this work w/ GUI texts?
xXEliteTacoXx 5 months ago
This has been flagged as spam show
Consabre 5 months ago
This has been flagged as spam show
Consabre 5 months ago
This has been flagged as spam show
Consabre 5 months ago
Consabre 5 months ago
Consabre 5 months ago
HOW DO YOU KNOW ALL OF THIS!
davtime 5 months ago
@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. :)
infiniteammoinc 6 months ago
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].OnSelected(true); part
TheToonamo 6 months ago
Comment removed
TheToonamo 6 months ago
Comment removed
TheToonamo 6 months ago
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.length' is read only.
Grow1229 8 months ago
it compiles properly without a single bug but the menu buttons still do not show in the inspector at all
UC3F10101CGD 9 months ago
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?
Zynt453 10 months ago
You said "I'm making this up as I go along."
Mr Wingit.
What a fantastic way to teach.
psstheyyou 11 months ago
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.
psstheyyou 11 months ago
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:NameOfTheScript[]" or vice versa?
Sanjuro2115 11 months ago
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 1 year ago
@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 :(
Salafer1401 1 year ago
@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
zineddine16 1 year ago
@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
zineddine16 1 year ago
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!!!
HUMUNAHA 1 year ago
I can't get menu manager script working. it doesn't show like yours and i type word for word. help please :)
keithvaughns 1 year ago
hey couldnt you just have used getbuttondown instead of getaxis ??
tekhiun 1 year ago
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.
rustandbleed 1 year ago
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 1 year ago 6
@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 1 year ago
@infiniteammoinc
there are no errors.BUT it still doesnt work
BTW thank you for replying
LRMANIA 1 year ago
@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].GetComponent("MenuItem").OnSelected(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.
havokjinx 1 year ago
@infiniteammoinc no errors, compiles and still no sign of the array var
Ironmillos 11 months ago
@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 1 year ago 9
@2048Terrabit
THANKS!!!il see if that works after i have cured from the cold.thanks again!
LRMANIA 1 year ago
@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 :)
KSLittlestar 1 year ago
@2048Terrabit thanks
economakis 11 months ago
@2048Terrabit : genious thx:D. I spent more than an hour trying to fix this :S
mrAddicted1990 2 months ago
This has been flagged as spam show
It says The name 'MenuItem' does not denote a valid type
FunkyFrog14 1 year ago
@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.
Tarkoal 1 year ago
it gives me this error
The name 'MenuItem' does not denote a valid type.
can you help me pls
piratus96 1 year ago
For those shorthand "if" statements, are the yeilds inside the brackets if I'm writing them out longer?
St4rdog 1 year ago
thanks for your tutorials.
sandolkakos 1 year ago