public function LateUpdate() : void {
//Checking jumping by using Raycast
var hit = RaycastHit;
var v3_hit : Vector3 = transform.TransformDirection (-Vector3.up) * (f_height * 0.5);
var v3_right : Vector3 = new Vector3(transform.position.x + (collider.bounds.size.x0.45), transform.position.y, transform.position.z);
var v3_left : Vector3 = new Vector3(transform.position.x - (collider.bounds.size.x0.45), transform.position.y, transform.position.z);
**if (Physics.Raycast (transform.position, v3_hit, hit, 2.5, layerMask.value)) {**
b_isJumping = false;
**}else if (Physics.Raycast (v3_right, v3_hit, hit, 2.5, layerMask.value)) {**
if (b_isJumping) {
b_isJumping = false;
}
**} else if (Physics.Raycast (v3_left, v3_hit, hit, 2.5, layerMask.value)) {**
if (b_isJumping) {
b_isJumping = false;
}
} else {
if (!b_isJumping) {
if (Mathf.Floor(transform.position.y) == f_lastY) {
b_isJumping = false;
} else {
b_isJumping = true;
}
}
}
I should point out this is only part of the full script, the lines marked are the ones showing errors.
Today is my first day using Unity and following Unity 3 Game Development Hotshot eBook. Followed the code to the letter, even checked it with the real file you can download. They are exactly the same yet this one will not shake off the error.
Have checked against the true file and the book, the true file does not throw any errors even though they are EXACTLY the same.
I’m positive its something very simple…any help greatly appreciated.