Search Unity

Play cutscene

Discussion in 'Scripting' started by Falin, Sep 22, 2010.

  1. Falin

    Falin

    Joined:
    Sep 29, 2009
    Posts:
    242
    So i made a Cutscene with the Cutscene editor.
    In The User's Manual says that i need to put:
    Code (csharp):
    1. scene.PlayCutscene();
    2.  
    to play the Cutscene.
    But i get an error:
    Code (csharp):
    1. Unknown identifier: 'scene'.
    Some help or advice would be great.
     
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    scene refers to the Cutscene gameobject :
    Code (csharp):
    1. var scene : GameObject;
    2.  
    3. function Update () {
    4.     if(Input.GetKeyDown("space"))
    5.         scene.GetComponent("Cutscene").PlayCutscene();
    6. }
     
  3. Falin

    Falin

    Joined:
    Sep 29, 2009
    Posts:
    242
    thanks