Guest User

Untitled

a guest
Aug 6th, 2012
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma strict
  2. var guiCountDown :GUIText;
  3. var countMax : int;
  4. private var countDown : int;
  5.  
  6.  
  7. function Start(){
  8.     guiCountDown.enabled=true;
  9.     GameBegin();
  10. }
  11.  
  12. function Update () {
  13.  
  14. }
  15.  
  16. function GameBegin(){
  17.     var car =GameObject.Find("Car");
  18.     // ==>> (OldOne) var drivingScript =car.GetComponent("CarDynamics");
  19.     // ==>>(new one) :
  20.      var drivingScript =car.GetComponent.<CarDynamics>();
  21.     // ==>> (Not Working!!!) drivingScript.enabled=false;
  22.    
  23.     for (countDown = countMax; countDown>0;countDown--){
  24.         guiCountDown.text = countDown.ToString();
  25.         yield WaitForSeconds(1);
  26.     }
  27.  
  28.     guiCountDown.enabled=false;
  29.     drivingScript.enabled=true;
  30. }
  31.  
  32.  
  33. //error :  Assets/StartCountDown.js(18,46): BCE0018: The name 'CarDynamics' does not denote a valid type ('not found').
Advertisement
Add Comment
Please, Sign In to add comment