Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

accessing the name string

Discussion in 'Scripting' started by spiralgear, Dec 14, 2007.

  1. spiralgear

    spiralgear

    Joined:
    Dec 13, 2007
    Posts:
    528
    how can i use the transform.name string to make another string composed of the first few letters in the name


    example:

    transform.name=because

    ????

    var a=becau
     
  2. Talzor

    Talzor

    Joined:
    May 30, 2006
    Posts:
    197
  3. spiralgear

    spiralgear

    Joined:
    Dec 13, 2007
    Posts:
    528
    perfect thats exactly what i needed


    thanks alot
     
  4. DocSWAB

    DocSWAB

    Joined:
    Aug 28, 2006
    Posts:
    615
    Very good to know, especially since this functionality is the string.substr functionality of plain JavaScript (rather than .Net/ Mono).