Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bool or boolean and float and int and other things help needed

Discussion in 'Scripting' started by hassanF15, Nov 1, 2014.

  1. hassanF15

    hassanF15

    Joined:
    Nov 1, 2014
    Posts:
    7
    i was trying to learn about this wierd things
    bool , int , float , var , update , awake , sleep
    :( and those things cant get in my head
    in int and float has a lot of numbers i couldn't understand anything
    and awake and update and start and sleep didnt get anything too what is start and update
    i ll really need to know it
    thx for reading :(
     
  2. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    226
  3. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,680
    Those "things" aren't "wierd". They are essential elements, tools what have you, to programming. If you can not get a grasp on them, you have no hope in programming. I am not saying you have no hope, but if you can't learn them, try accounting.

    Cheers!
     
  4. ZO5KmUG6R

    ZO5KmUG6R

    Joined:
    Jul 15, 2010
    Posts:
    489
  5. hassanF15

    hassanF15

    Joined:
    Nov 1, 2014
    Posts:
    7
    i know i know
    i tried to understand it but i need someone to make it easier for example
    bool = true or false thats easy one couse its true and false
    but
    what's the difference betwen
    Int , Float ? an example for a question :/
     
  6. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    • bool - true or false (boolean in js, bool in c#)
    • int - whole numbers (1, 10, 35336, -10)
    • float - deccimal numbers (3.6, 10.635, -0.0045 4.5f in c#)
    • var - 'variable' - indicates the next word will be the name of a variable (eg. "var myFloat = 3.6". [js] now 'myFloat' has the float value of 3.6)
    • update - code in update runs once every frame
    • awake - code in awake runs once when the object the script is attached to become active or is instanced
    • sleep - ? - A rigidbody (physics entity) can be asleep, this means it does not apply physics to it
     
    tawakalhasnain729 and gliealonso like this.
  7. hassanF15

    hassanF15

    Joined:
    Nov 1, 2014
    Posts:
    7
    now thats what i meant !!!
    thx man !! :D
     
    Steg11805 and gliealonso like this.
  8. bluekingassassins

    bluekingassassins

    Joined:
    Aug 16, 2019
    Posts:
    1
  9. Owen-Reynolds

    Owen-Reynolds

    Joined:
    Feb 15, 2012
    Posts:
    1,911
    FYI: this is a necro'd 6-year-old post.