hi when I press the play button the error say
OnControllerColliderHit couldn't be called because the expected parameter ControllerColliderHit doesn't match Collider.
UnityEngine.CharacterController:SimpleMove(Vector3)
UnityEngine.CharacterController:SimpleMove(Vector3)
movearond:Update() (at Assets\movearond.js:73)
[..\..\Runtime\Mono\MonoBehaviour.cpp line 1383]
I cant figure out whats wrong well I know that the moving and the oncontrollercoliderhit is messing
my script is (look at line 74 I guess it wrong there)
//Moving around
var speed = 3.0;
var rotateSpeed = 3.0;
//Shooting
var bullitPrefab:Transform;
//Dying
private var dead = false;
//Geting hit
var tumbleSpeed = 800;
var decreaseTime = 0.01;
var decayTime = 0.01;
static var gotHit = false;
private var backup = [tumbleSpeed, decreaseTime, decayTime];
function LateUpdate()
{
if (dead)
{
transform.position = Vector3(0,4,0);
gameObject.Find("Main Camera").transform.position = Vector3(0,4,-10);
dead = false;
}
if (gotHit)
{
if(tumbleSpeed < 1)
{
//we're not hit anymore... reset get back in the game!
tumbleSpeed = backup[0];
decreaseTime = backup[1];
decayTime = backup[2];
gotHit = false;
}
else
{
//we're hit! Spin our charavter around
transform.Rotate(0,tumbleSpeed * Time.deltaTime,0, Space.World);
tumbleSpeed = tumbleSpeed-decreaseTime;
decreaseTime += decayTime;
}
}
}
//function OnControllerColliderHit(hit : ControllerColliderHit)
function OnControllerColliderHit ( hit : Collider )
{
if(hit.gameObject.tag == "fallout")
{
dead = true;
//substract life here
HealthControll.LIVES -= 1;
}
if(hit.gameObject.tag == "fiendeball" )
{
gotHit = true;
HealthControll.LIVES += 1;
Destroy(hit.gameObject);
}
}
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,
transform.Find("spawnpoint").transform.position,Quaternion.identity);
bullit.rigidbody.AddForce(transform.forward * 2000);
}
}
@script RequireComponent(CharacterController)
//txzzo[/code]