private var canWallJump : boolean=false;
private var canWallJumpTime : float=0;
private var canWallJumpDir : Vector3 = Vector3.zero;
private var lastDirection : Vector3;
function OnCollisionEnter(hit : Collision) {
if(controller.isGrounded == false){
for (var contact : ContactPoint in collision.contacts) {
if(hit.collider.gameObject.tag == "Wall"){
canWallJump = true;
canWallJumpTime = Time.time;
canWallJumpDir = Vector3.Scale(Vector3(-1,0,-1), lastDirection);
}
}
}
}
function Update()
{
if(Time.time - canWallJumpTime > 0.25) canWallJump = false;
if(Input.GetButtonDown ("Jump") ("canWallJump"))
}
// calculate movement and apply it to the controller
if(Vector2(movement.x, movement.z).magnitude > 0.001) lastDirection = movement;
}
I want to create a Parkour game with Wall jumps and I tried this script
But if I save the script there comes this error: BCE0043: Unexpected token: }.
Can you help me?
↧