• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
-1
Question by Intensity3000 · Jun 25, 2014 at 11:31 PM · inspector

New Variables I Create Don't Appear In Inspector

I've tried everything I know and also submitted a bug report about it, there's only one thing left I can think of to ask and it is this: If I put a lot of variables (50+) in a script to appear in the inspector, could that overload the inspector and make it unable to display any more variables? The variables are all public, none are static or internal or private, there are no compiler errors and I have verified multiple times that my syntax is correct

 //Variables for functions inside of script.
 @System.NonSerialized 
 var isPaused : boolean;
 @System.NonSerialized
 var selectedButton : GameObject;
 @System.NonSerialized
 var selectedInventory : GameObject;
 var inventoryObject : GameObject;
 var character : GameObject;
 var inventoryMenu : GameObject;
 var hand : Transform;
 var cam : Transform;
 var actionRange : float;
 var itemDrop : Transform;
 //Buttons.
 var resume : GameObject;
 var use : GameObject;
 var eatDrink : GameObject;
 var combine : GameObject;
 var drop : GameObject;
 var discard : GameObject;
 var backpackTransfer : GameObject;
 var load : GameObject;
 var save : GameObject;
 var options : GameObject;
 var quit : GameObject;
 //Backpack Variables.
 var hasBackpack : boolean;
 var backpackAddOn : GUITexture;
 var backpackTexture : Texture;
 var noBackpackTexture : Texture;
 var backpackSlotOne : GameObject;
 var backpackSlotTwo : GameObject;
 var backpackSlotThree : GameObject;
 var backpackSlotFour : GameObject;
 var backpackSlotFive : GameObject;
 var backpackSlotSix : GameObject;
 var backpackSlotSeven : GameObject;
 var backpackSlotEight : GameObject;
 var backpackSlotNine : GameObject;
 var backpackSlotTen : GameObject;
 var backpackSlotEleven : GameObject;
 var backpackSlotTwelve : GameObject;
 var backpackSlotThirteen : GameObject;
 var backpackSlotFourteen : GameObject;
 var backpackSlotFifteen : GameObject;
 var backpackSlotSixteen : GameObject;
 var backpackSlotSeventeen : GameObject;
 var backpackSlotEighteen : GameObject;
 var backpackSlotNineteen : GameObject;
 var backpackSlotTwenty : GameObject;
 var backpackSlotTwentyOne : GameObject;
 var backpackSlotTwentyTwo : GameObject;
 var backpackSlotTwentyThree : GameObject;
 var backpackSlotTwentyFour : GameObject;
 var backpackSlotTwentyFive : GameObject;
 var backpackSlotTwentySix : GameObject;
 var backpackSlotTwentySeven : GameObject;
 var backpackSlotTwentyEight : GameObject;
 //Description Lines.
 var descriptionOne : GUIText;
 var descriptionTwo : GUIText;
 var descriptionThree : GUIText;
 var descriptionFour : GUIText;
 var descriptionFive : GUIText;
 var descriptionSix : GUIText;
 var descriptionSeven : GUIText;
 //InventorySlots.
 var inventorySlotOne : GameObject;
 var inventorySlotTwo : GameObject;
 var inventorySlotThree : GameObject;
 var inventorySlotFour : GameObject;
 var inventorySlotFive : GameObject;
 var inventorySlotSix : GameObject;
 //Options.
 var optionOne : GameObject;
 var optionTwo : GameObject;
 var optionThree : GameObject;
 var optionFour : GameObject;
 var optionFive : GameObject;
 var optionSix : GameObject;
 var optionSeven : GameObject;
 //GUI Message.
 var message : GUIText;
 
 function Start () {
 isPaused = true;
 character.SetActive(false);
 }
 
 function Update () {
 //If statements to pause and unpause the game. Inventory menu
 //appears when game is paused.
 
     if (Input.GetButtonDown("Pause") && isPaused) {
             if (selectedButton != null) {
                 selectedButton.GetComponent(ButtonScript).isSelected = false;
                 selectedButton = null;
             }
             
             if (selectedInventory != null) {
                 selectedInventory.GetComponent(ButtonScript).selectedInventory = false;
                 selectedInventory = null;
             }
         character.SetActive(true);
         isPaused = false;
         Screen.showCursor = false;
         inventoryMenu.SetActive(false);
     }
 
     else if (Input.GetButtonDown("Pause") && isPaused == false) {
         character.SetActive(false);
         isPaused = true;
         Screen.showCursor = true;
         inventoryMenu.SetActive(true);
     }
     
     if (selectedButton == resume && Input.GetButtonDown("Primary Attack")) {
             if (selectedButton != null) {
                 selectedButton.GetComponent(ButtonScript).isSelected = false;
                 selectedButton = null;
             }
             
             if (selectedInventory != null) {
                 selectedInventory.GetComponent(ButtonScript).selectedInventory = false;
                 selectedInventory = null;
             }
         character.SetActive(true);
         isPaused = false;
         Screen.showCursor = false;
         inventoryMenu.SetActive(false);
     }
 
 // Unlinks "selectedButton" when no longer selected. (Button is selected when mouse cursor hovers over it)
     if (selectedButton != null && selectedButton.GetComponent(ButtonScript).isSelected == false) {
         selectedButton = null;
     }
 
 //Enable or Disable Backpack Graphics in Menu.
     if (hasBackpack) {
         backpackAddOn.texture = backpackTexture;
     }
     
     if (hasBackpack == false) {
         backpackAddOn.texture = noBackpackTexture;
         backpackSlotOne.guiText.text = "";
         backpackSlotTwo.guiText.text = "";
         backpackSlotThree.guiText.text = "";
         backpackSlotFour.guiText.text = "";
         backpackSlotFive.guiText.text = "";
         backpackSlotSix.guiText.text = "";
         backpackSlotSeven.guiText.text = "";
         backpackSlotEight.guiText.text = "";
         backpackSlotNine.guiText.text = "";
         backpackSlotTen.guiText.text = "";
         backpackSlotEleven.guiText.text = "";
         backpackSlotTwelve.guiText.text = "";
         backpackSlotThirteen.guiText.text = "";
         backpackSlotFourteen.guiText.text = "";
         backpackSlotFifteen.guiText.text = "";
         backpackSlotSixteen.guiText.text = "";
         backpackSlotSeventeen.guiText.text = "";
         backpackSlotEighteen.guiText.text = "";
         backpackSlotNineteen.guiText.text = "";
         backpackSlotTwenty.guiText.text = "";
         backpackSlotTwentyOne.guiText.text = "";
         backpackSlotTwentyTwo.guiText.text = "";
         backpackSlotTwentyThree.guiText.text = "";
         backpackSlotTwentyFour.guiText.text = "";
         backpackSlotTwentyFive.guiText.text = "";
         backpackSlotTwentySix.guiText.text = "";
         backpackSlotTwentySeven.guiText.text = "";
         backpackSlotTwentyEight.guiText.text = "";
     }
 
 //Pick Up Items and Action Button.
 var fwd = Vector3.forward;
 fwd = cam.TransformDirection(fwd);
 var actionRayHit : RaycastHit;
 var actionRay = Physics.Raycast(hand.position, fwd, actionRayHit, actionRange);
 
     if (actionRay && actionRayHit.collider.tag == "PickUp" && Input.GetButtonDown("Action")) {
         //Inventory Slot 1.
         if (inventorySlotOne.GetComponent(ButtonScript).contents == "") {
             inventorySlotOne.GetComponent(ButtonScript).contents = actionRayHit.collider.name;
             inventorySlotOne.GetComponent(ButtonScript).quantity += 1;
             inventorySlotOne.GetComponent(ButtonScript).limit = actionRayHit.collider.gameObject.GetComponent(PickUpScript).limit;
             inventorySlotOne.GetComponent(ButtonScript).contentsObject = actionRayHit.collider.gameObject.GetComponent(PickUpScript).itemObject;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         else if (inventorySlotOne.GetComponent(ButtonScript).contents == actionRayHit.collider.name) {
             inventorySlotOne.GetComponent(ButtonScript).quantity += 1;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         //Inventory Slot 2.
         else if (inventorySlotTwo.GetComponent(ButtonScript).contents == "") {
             inventorySlotTwo.GetComponent(ButtonScript).contents = actionRayHit.collider.name;
             inventorySlotTwo.GetComponent(ButtonScript).quantity += 1;
             inventorySlotTwo.GetComponent(ButtonScript).limit = actionRayHit.collider.gameObject.GetComponent(PickUpScript).limit;
             inventorySlotTwo.GetComponent(ButtonScript).contentsObject = actionRayHit.collider.gameObject.GetComponent(PickUpScript).itemObject;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         else if (inventorySlotTwo.GetComponent(ButtonScript).contents == actionRayHit.collider.name) {
             inventorySlotTwo.GetComponent(ButtonScript).quantity += 1;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         //Inventory Slot 3.
         else if (inventorySlotThree.GetComponent(ButtonScript).contents == "") {
             inventorySlotThree.GetComponent(ButtonScript).contents = actionRayHit.collider.name;
             inventorySlotThree.GetComponent(ButtonScript).quantity += 1;
             inventorySlotThree.GetComponent(ButtonScript).limit = actionRayHit.collider.gameObject.GetComponent(PickUpScript).limit;
             inventorySlotThree.GetComponent(ButtonScript).contentsObject = actionRayHit.collider.gameObject.GetComponent(PickUpScript).itemObject;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         else if (inventorySlotThree.GetComponent(ButtonScript).contents == actionRayHit.collider.name) {
             inventorySlotThree.GetComponent(ButtonScript).quantity += 1;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         //Inventory Slot 4.
         else if (inventorySlotFour.GetComponent(ButtonScript).contents == "") {
             inventorySlotFour.GetComponent(ButtonScript).contents = actionRayHit.collider.name;
             inventorySlotFour.GetComponent(ButtonScript).quantity += 1;
             inventorySlotFour.GetComponent(ButtonScript).limit = actionRayHit.collider.gameObject.GetComponent(PickUpScript).limit;
             inventorySlotFour.GetComponent(ButtonScript).contentsObject = actionRayHit.collider.gameObject.GetComponent(PickUpScript).itemObject;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         else if (inventorySlotFour.GetComponent(ButtonScript).contents == actionRayHit.collider.name) {
             inventorySlotFour.GetComponent(ButtonScript).quantity += 1;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         //Inventory Slot 5.
         else if (inventorySlotFive.GetComponent(ButtonScript).contents == "") {
             inventorySlotFive.GetComponent(ButtonScript).contents = actionRayHit.collider.name;
             inventorySlotFive.GetComponent(ButtonScript).quantity += 1;
             inventorySlotFive.GetComponent(ButtonScript).limit = actionRayHit.collider.gameObject.GetComponent(PickUpScript).limit;
             inventorySlotFive.GetComponent(ButtonScript).contentsObject = actionRayHit.collider.gameObject.GetComponent(PickUpScript).itemObject;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         else if (inventorySlotFive.GetComponent(ButtonScript).contents == actionRayHit.collider.name) {
             inventorySlotFive.GetComponent(ButtonScript).quantity += 1;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         //Inventory Slot 6.
         else if (inventorySlotSix.GetComponent(ButtonScript).contents == "") {
             inventorySlotSix.GetComponent(ButtonScript).contents = actionRayHit.collider.name;
             inventorySlotSix.GetComponent(ButtonScript).quantity += 1;
             inventorySlotSix.GetComponent(ButtonScript).limit = actionRayHit.collider.gameObject.GetComponent(PickUpScript).limit;
             inventorySlotSix.GetComponent(ButtonScript).contentsObject = actionRayHit.collider.gameObject.GetComponent(PickUpScript).itemObject;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
         
         else if (inventorySlotSix.GetComponent(ButtonScript).contents == actionRayHit.collider.name) {
             inventorySlotSix.GetComponent(ButtonScript).quantity += 1;
             Destroy(actionRayHit.collider.gameObject);
             message.text = "You picked up a " + actionRayHit.collider.name;
         }
     }
 
 //Select Inventory Items
     if (selectedButton != null && selectedButton.tag == "InventorySlot" && Input.GetButtonDown("Primary Attack")) {
         if (selectedInventory == null) {
             selectedButton.GetComponent(ButtonScript).selectedInventory = true;
             selectedInventory = selectedButton;
         }
 
         else if (selectedInventory != null && selectedInventory == selectedButton) {
             selectedInventory.GetComponent(ButtonScript).selectedInventory = false;
             selectedInventory = null;
         }
 
         else if (selectedInventory != null) {
             selectedInventory.GetComponent(ButtonScript).selectedInventory = false;
             selectedButton.GetComponent(ButtonScript).selectedInventory = true;
             selectedInventory = selectedButton;
         }
     }
 
 //Drop Items.
     if (selectedInventory != null && selectedInventory.GetComponent(ButtonScript).contents != "" && selectedButton == drop &&
     Input.GetButtonDown("Primary Attack")) {
         selectedInventory.GetComponent(ButtonScript).quantity -= 1;
     }
 
 //Discard Items.
     
     if (selectedInventory != null && selectedInventory.GetComponent(ButtonScript).contents != "" && selectedButton == discard &&
     Input.GetButtonDown("Primary Attack")) {
         selectedInventory.GetComponent(ButtonScript).quantity -= 1;
     }
 }

Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AndyMartin458 · Jun 26, 2014 at 12:13 AM 1
Share

@Intensity3000 try taking a look at this blog post unity made about serialization. http://blogs.unity3d.com/2014/06/24/serialization-in-unity/

avatar image Bunny83 · Jun 26, 2014 at 02:20 AM 0
Share

@Intensity3000: Please include your script or at least a script that reproduces your problem. Unity doesn't have a limitation of variables, only a max cascade-depth of 7 (like you can read in the blog-post Andy$$anonymous$$artin458 has linked above).

Are you sure that your variables are actually of a serializable type? $$anonymous$$ake sure Unity actually reloaded your script. Sometimes it doesn't "see" that it has been updated. We can't "answer" your question without more information.

avatar image Intensity3000 · Jun 29, 2014 at 10:21 PM 1
Share

well I did some research on what a "cracked" unity is and no im not using a "cracked" pro version of unity I'm using the legitimate free version.

avatar image Bunny83 · Jun 30, 2014 at 03:57 AM 1
Share

@Intensity3000:

What specifically isn't showing up in the inspector? $$anonymous$$aybe you just have to scroll down a bit because it doesn't fit on your screen anymore? Can you make a screenshot showing the component attached to a gameobject?

ps: Ever heard of arrays? ;)

avatar image Bunny83 · Jun 30, 2014 at 03:59 AM 1
Share

@iamthecoolguy11: You're certainly not "the cool guy" when using a cracked illegal version of Unity.

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

object can't be null when highlighted in the inspector? 1 Answer

How To Force an Inspector to Repaint 3 Answers

Get the highlighted variable in the inspector 0 Answers

Variables assigned in inspector disappear in git version-control? 1 Answer

I want to customize 'open' button in inspector 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges