Hi
I have follow a guid from TornadoTwins and I cant get my “worm” to re spawn when it fall out of the platform.
my script is (i guess its wrong whiv false and true beacuse thay dont change collors
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 LateUpdate()
{
if (dead)
{
transform.position = Vector3(0,4,0)
gameObject.Find(“Main Camera”).transform.position = Vector3(0,4,-10)
dead = false;
}
}
@script RequireComponent(CharacterController)
and my error code is
Assets/movearond.js(36,36): UCE0001: ‘;’ expected. Insert a semicolon at the end.
yeah I did spell it wrong.
But it still say that it is a error but not on my movearound script its say that it is on my lifecontroll script.
but when I try to add the movearound script to my worm it say that I need to fix all bugg first.
yes, you have a reference in your move around script that points to the healthcontroll script ( not the lifecontroll which you had )
all you had to do is change the name of your lifecontroll to healthcontroll