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 /
  • Help Room /
avatar image
0
Question by WinterStormStudios · Sep 01, 2016 at 09:17 PM · script.variablesstringvar type

what is a string ? i dont understand please help

i am learning unityScript/javaScript for the first time NO EXPERIENCE IN ANY Language i am completely new to code so i a am learning unity script and so far ive learned a lil curly braces and round brackets and dots variables functions and now i am learning variable types such as int, float, Boolean, and string,

i understand int is a round number float is a decimal number and Boolean is true or false or false

but i cant understand what is string

i understand its characters but i don't get what for

what is it used for whats the purpose what dose it do you STRING characters together for text is it a gui text type thing i just cant grasp it so please any help at all will be great but as i said i am extremely new to scripting so explain like if i was a 8 year old lol thanks in advance

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
Best Answer

Answer by doublemax · Sep 01, 2016 at 09:51 PM

Yes, as you already said, a string stores a sequence of characters that form a text, like "Hello" or "WinterStormStudios". They are used for many purposes. It could be the display of a score, displaying a players name or some text message that appears on the screen, like "You Win!".

Inside Unity there are also other occurences, e.g. as the name of an object, the tag of an object or the name of a layer. These are all strings.

Comment
Add comment · Show 2 · 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 WinterStormStudios · Sep 01, 2016 at 10:30 PM 0
Share

and also cant you just use guitext or UItext

avatar image doublemax WinterStormStudios · Sep 01, 2016 at 10:44 PM 0
Share

A string is a variable type, a simple container for a sequence of letters, nothing more. guitext or UItext are much more complex classes that are used to display a string on screen. $$anonymous$$g. they also contain attributes how the text should be displayed, font, color, size, alignment and so on.

avatar image
0

Answer by WinterStormStudios · Sep 01, 2016 at 10:29 PM

alt textthank you so much @doublemax

also tell me if im on the right track to see if im really getting it

when function WereAreYou is called it grabs the text from location and noclue and dose somthing whit it ??


learning.png (146.6 kB)
Comment
Add comment · Show 2 · 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 doublemax · Sep 01, 2016 at 10:39 PM 0
Share

when function WereAreYou is called it grabs the text from location and noclue and dose somthing whit it ??

Yes, exactly. A string variable is not that different to the other types. But ins$$anonymous$$d of a number it stores a sequence of letters.

avatar image WinterStormStudios doublemax · Sep 01, 2016 at 10:55 PM 1
Share

great thanks so much man for the help

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

68 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

Related Questions

Executing variables as code? 1 Answer

assign a new value to a variable 0 Answers

How to connect two c# scripts and connect varibles? 1 Answer

Script error and no Variables showing 0 Answers

How to compare two different variables in two different scripts? 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