can someone tell me what im doing wrong i want to die if i do sertain things heres the whole script:

  var speed = 3.0;
  var rotateSpeed = 3.0;
  var bullitPrefab:Transform;
  private var dead = false;

  function OnControllerColliderHit(hit: ControllerColliderHit)
  {
    if(hit.gameObject.tag == "fallout")
    {
      dead = true;
      //substract life here
    }
  }

  function Update ()
  {
    var controller : CharacterController = GetComponent(CharacterController);
    transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
    var forward = transform.TransformDirection(Vector3.forward);
    var curSpeed = speed * Input.GetAxis ("Vertical");
    controller.SimpleMove(forward * curSpeed);

    if(Input.GetButtonDown("Jump"))
    {
      var bullit = Instantiate( bullitPrefab, 
                               GameObject.Find("spawnPoint").transform.position,
                               Quaternion.identity);
      bullit.rigidbody.AddForce(transform.forward * 2000);        
    }

  }

  function LaterUpdate()
  {
    if(dead)

      transform.position = Vector3(0,4,0);
    gameObject.Find("Main Camera").transform.position = Vector3(0,4,-10);
    dead = false;
  }

  @script RequireComponent(CharacterController)

Hi again,

the function is called: `function LateUpdate () {}` and not Late*r*Update()

Hi,

Did you forget the '{}' in the if(dead)????

I don't know what do you want to do, but maybe it is taht your problem. Now your code is like this:

  function LaterUpdate()
  {
    if(dead){
      transform.position = Vector3(0,4,0);
    }

    gameObject.Find("Main Camera").transform.position = Vector3(0,4,-10);
    dead = false;
  }