Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This question was closed Mar 14, 2014 at 10:29 PM by thenachotech1113 for the following reason:

Other

avatar image
-3
Question by thenachotech1113 · Feb 02, 2014 at 01:38 AM · arraylengthwith

get length of array c#

hello everyone, here is an easy question. I have spend days looking everywhere on how to get the length of an array on c#, the way I have it set up now is the following:

 public Transform[] transformArray;
 
 
 void Update (){
      Debug.log("Array length is:" + transformArray.Length);
 }

well at least this is what i am trying to do but not only the "Length" doesent apear in the options, when i put it it retourns an error. if some one know what am i doing wrong pls tell, i am loosing sleep, i dont get how is something so used be so damn hard to do for me. thank you all in advanced.

Comment
Add comment · Show 8
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 ffxz7ff · Feb 02, 2014 at 01:41 AM 1
Share

"an error"? What error?

avatar image giudark · Feb 02, 2014 at 02:01 AM 3
Share

all correct except

 Debug.log 

that have to be

 Debug.Log


the array builtin is a a row type so there isn't need to inizialize and to access the dimension Length is correct, so .. boh XD

avatar image Sundar · Feb 02, 2014 at 02:02 AM 1
Share

Did you add any transform in the inspector? if not add some then debug in Start() ins$$anonymous$$d of Update() just for testing.

avatar image iwaldrop · Feb 02, 2014 at 07:50 AM 1
Share

@Benproductions1 You're fast! I deleted my comment because the use of an Update method does strongly imply a $$anonymous$$onoBehaviour. On a side note, what's the markup for 'preformatted' text as you used in your comment above?

Edit: corrected misspelling if name benproductions => Benproductions1

avatar image Benproductions1 · Feb 04, 2014 at 09:15 AM 1
Share

@iwaldrop you forgot the "1" when referencing my name :P (That "1" is very important to me XD)

I's funny we came to the same conclusion, the way you do the special formatting is using the ` character ;) (You're the first person to ask that, so thumbs up to you sir!)

Show more comments

1 Reply

  • Sort: 
avatar image
0

Answer by unimechanic · Feb 21, 2014 at 07:37 PM

Question solved by user who closed it without answering. Adding this answer to remove it from the Unanswered view and give more relevance to other questions requiring attention. Thanks for your comprehension, Unity Support.

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

Follow this Question

Answers Answers and Comments

23 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

Related Questions

Assets/Gravitation_Simulator.cs(23,47): error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `Length' and no extension method `Length' of type `UnityEngine.GameObject' could be found. 2 Answers

Static Array - Throwing NullReference 1 Answer

variables based on array.length not updating in JS 1 Answer

How to add an object to an array? 1 Answer

Why is this array out of length? 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