Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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
2
Question by yz09tech · Feb 26, 2019 at 12:42 AM · editorscript.issue

Tanks 3D: The tanks index does not show up in the Inspector/Game Manager script

I made sure that I was using the correct code in the CameraControl and GameManager scripts. As instructed in the tutorial, I also used the following line in the CameraControl script: [HideInInspector] public Transform[] m_Targets; However, the tanks index does not show up in the Inspector/Game Manager component. What am I doing wrong?

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by CBlockSurprise · Feb 26, 2019 at 06:25 AM

@yz09tech - A [HideInInspector] hides the public variable from the inspector. If you delete it, it should show the array. Change:

 [HideInInspector]
 public Transform[] m_Targets;

to just this:

 public Transform[] m_Targets;


(Also looking at your code and editing it)

 using UnityEngine; 
 public class CameraControl : MonoBehaviour { 
     public float m_DampTime = 0.2f;
     public float m_ScreenEdgeBuffer = 4f; 
     public float m_MinSize = 6.5f;
     public Transform[] m_Targets; //This line is the tank index, and a comment.
     // The next line is supposed to show the tanks index in the 


That should work. You had a // in front of your array, and a // means that it is just a comment, not affecting the code

Comment
Add comment · Share
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
0

Answer by yz09tech · Feb 26, 2019 at 02:36 PM

Thank you. I changed the script as you said, but still it does not show the tanks index in the Inspector/GameManager. Taking the [HideInInspector] out works ok when used with the Inspector.CameraRig (the tanks index appear). What could be causing the problem in the Inspector/GameManager?

Comment
Add comment · Show 3 · Share
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 CBlockSurprise · Feb 26, 2019 at 03:06 PM 0
Share

Would you be able to show the code? It will be easier for solving the issue.

avatar image yz09tech · Feb 26, 2019 at 03:46 PM 0
Share

The upper code in the CameraControl script is as follows:

using UnityEngine; public class CameraControl : $$anonymous$$onoBehaviour { public float m_DampTime = 0.2f;
public float m_ScreenEdgeBuffer = 4f; public float m_$$anonymous$$inSize = 6.5f;

// public Transform[] m_Targets; This line shows the tanks index in the Inspector/CameraRig: // The next line is supposed to show the tanks index in the Ibspector/Game$$anonymous$$anager: [HideInInspector] public Transform[] m_Targets;

….…

I tied to attach the images of the Inspector/CameraRig and Inspector/Game$$anonymous$$anager but the attachment option (paper clip) didn't work.

avatar image yz09tech · Feb 26, 2019 at 09:11 PM 0
Share

I was not able to attach an image to this message, so I started a new message and used chrome to attach the image. Please take a look at it.

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.

Follow this Question

Answers Answers and Comments

140 People are following this question.

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

Related Questions

Open settings dialog like Player, Quality, Render Settings via C#. 0 Answers

How can i make both two cameras to follow the player but only one with control on player ? 0 Answers

Tanks 3D: The tanks index missing in the Inspector/Game Manager script (Follow up) 2 Answers

How can I get the name of a class into a script from the editor. 1 Answer

Editor Import Script for Platform Settings 0 Answers


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