could someone please give me the finished twins tornado script please.
what’s wrong with my script. it does not work
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);
// Rotate around y - axis
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
// Move forward / backward
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 LateUpdate()
{
if (dead)
{
transform.positiion = Vector3(0,4,0);
gameObject.Find(“Main Camera”).transform.position = Vector3(0,4,-10);
dead = false;
}
}
@script RequireComponent(CharacterController)