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
0
Question by yz09tech · Feb 26, 2019 at 08:41 PM · script.issue

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

     using UnityEngine; 
      public class CameraControl : MonoBehaviour { 
          public float m_DampTime = 0.2f;
          public float m_ScreenEdgeBuffer = 4f; 
          public float m_MinSize = 6.5f;
          
          /*
          This line shows the tanks index in the Inspector/CameraRig: 
                     public Transform[] m_Targets; 
          */
     
          /* This line is supposed to show the tanks index in the 
             Inspector/GameManager but it does not: */
 
          [HideInInspector] public Transform[] m_Targets; 
     
     --------------------
     ![alt text][1]


[1]: /storage/temp/133834-tanks.png

tanks.png (116.4 kB)
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 27, 2019 at 01:43 AM

@yz09tech - Based off of guesses you want to have it so you could add stuff to the array Targets. In order to do that, you have to add to the size of the Targets - make it a 1 or greater (or how many targets there are). If you want the Tank Prefab variable, you have to have a public GameObject tankPrefab; in your code. But from the type of game, it adds targets to it. The [HideInInspector] was to have it not edited and maybe later in the tutorial it creates a void to edit the targets array to add targets to it. If you have to edit the targets array or anything else that is missing, please link your code, the tutorial's code, and the tutorial itself.

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 27, 2019 at 03:20 AM

 I appreciate your response. 
 My problem was that the tanks index did not appear in the Inspector/GameManager and I was unable to do anything after that. 
 I finally decided to repeat all the steps in the Game Managers tutorial and, after I used the “[HideInInspector] public Transform[] m_Targets;” code in the CameraControl script, it worked! I got the tanks index in the Inspector/GameManager.
 I think that the original reason for my problem was that, after I created the GamaManager module, I made changes to the CameraControl script several times and this affected the tanks index.



Comment
Add comment · Show 1 · 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 27, 2019 at 04:47 AM 0
Share

Glad it finally worked

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

108 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

Related Questions

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

Issue with object not bouncing around screen correctly 1 Answer

Why on the mobile do the elements seem to have a very unstable position? 0 Answers

I don't understand Vector2 + Vector3 3 Answers

Unity UI 4.6 Canvas Enable/Disable make Accessible 2 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