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

function awake not playing nice

Discussion in 'Scripting' started by kurlzy, Jun 17, 2014.

  1. kurlzy

    kurlzy

    Joined:
    May 25, 2014
    Posts:
    8
    im just coding something simple but doesnt seem to want to play nice:
    Code (JavaScript):
    1.  var lifeTime = 1.0;
    2.  
    3.   function awake()
    4.   {
    5.      Destroy (gameObject, lifeTime);
    6.   }
    also have connected it to the prefab that also has a spawn point.. it fires fine enough but never seems to do its actual funtion which is destroy itself anyhelp...
     
  2. A.Killingbeck

    A.Killingbeck

    Joined:
    Feb 21, 2014
    Posts:
    483
    Capitalise the "A" in Awake
     
  3. kurlzy

    kurlzy

    Joined:
    May 25, 2014
    Posts:
    8
    o thanks shoulda seen it thanks how do i delete thread?
     
  4. Magiichan

    Magiichan

    Joined:
    Jan 5, 2014
    Posts:
    403
    Don't worry about it, other people might make the same mistake & see this post afterwards.