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 /
avatar image
4
Question by FLASHDENMARK · Nov 17, 2010 at 04:25 PM · stringbooleanfloatint

what the hell is a int? (or a float, or boolean, or string!)

hello, everyone.

I have heard int before but i dont know what it is and what it is used for. Can you guys possebly cast som light upon this, please? Thanks!

Comment
Add comment · Show 2
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 fireDude67 · Dec 07, 2010 at 02:01 AM 1
Share

Go ask generic-program$$anonymous$$g questions at stackoverflow.com

avatar image FLASHDENMARK · Jan 23, 2011 at 06:55 PM 0
Share

So fireDude67 I assume that you edited this post, right? But how is this not Unity related?

3 Replies

· Add your reply
  • Sort: 
avatar image
42
Best Answer

Answer by duck · Nov 17, 2010 at 04:48 PM

In Unity's Javascript and C#, int is a type. It is short for "integer", which means whole numbers. You use int to specify that you want your variable to contain only whole numbers.

For example, 3 is an integer. 3.25 is not an integer.

When programming, your variables generally have a specific type, and you should select the appropriate type according to what you want to use the variable for. Four of the most common types are:

  • int : An integer (eg, 3).
    Can be a whole number between -2147483648 and 2147483647

  • float : A fractional (floating point) number (eg, 3.25907).
    Can be a number between roughly 1.5 x 10^45 to 3.4 10^38, in floating point format.

  • String : A sequence of characters (eg, "Hello User 6555")
    (no specified maximum length, as far as I'm aware!)

  • boolean : A true/false value.
    Can only contain either the value true or false.

There are many more types that you can use for variables, including other numeric types for more specific situations, and other more complex types such as structs and classes which you will need to learn about in order to make progress using Unity.

Good luck :)

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

Answer by oliver-jones · Nov 17, 2010 at 04:28 PM

int just mean integer, which means number

Eg:

var Number : int = 4;

just means that the Number var only holds a number variable.

A variable can hold anything. Int just means that the variable is only limited to numbers

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 denewbie · Nov 17, 2010 at 04:30 PM 1
Share

just to add on, the integer is the same one we learn in our math classes. Integers are essentially whole numbers.

avatar image
3

Answer by vfxjex · Jul 10, 2014 at 05:19 PM

I thought you are referring to "int?".

just in case it means nullable int.

it refers to int that can be stored with a null.

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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

bool[string] = true; array possible? 2 Answers

Can I create a list with an int/float and a string? C# 2 Answers

Can a player change (int, string, float etc....) from outside the game? 3 Answers

GUI.Label shows volume from a slider 3 Answers

String can't be converted to float or int? 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