Tuesday, October 26, 2010

Week 4: Programming

function Update() {

if(Input.GetButtonDown("KeyBoardAttack(F)"))
{

swordenable();
}
}
function swordenable(){

gameObject.tag = "player_weapon";
print("namechanged");
yield WaitForSeconds(1);
gameObject.tag = "Untagged";
}

Code which solves the previous weeks problem. Now the dagger is only active for one second after you hit the attack button.

No comments:

Post a Comment