Advertisement
kasru

Player Attacks

Jan 30th, 2013
3,337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //****** Donations are greatly appreciated.  ******
  2. //****** You can donate directly to Jesse through paypal at  https://www.paypal.me/JEtzler   ******
  3.  
  4. var fireAttackPrefab : GameObject;
  5.  
  6. function OnGUI () {
  7.    
  8.     if (GUI.Button (Rect (Screen.width / 2,Screen.height / 2 + 100,80,20), "Attack1")) {
  9.         attackFire();
  10.     }
  11. }
  12.  
  13. function Update () {
  14.  
  15.     //attack fire
  16.     if(Input.GetKeyDown("1")) {
  17.         attackFire();
  18.     }
  19. }
  20.  
  21. function attackFire () {
  22.  
  23.     Instantiate(fireAttackPrefab,this.transform.position,this.transform.rotation);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement