Advertisement
Guest User

Untitled

a guest
Jul 6th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class PlayerCombat : MonoBehaviour
  6. {
  7.     public Animator anim;
  8.  
  9.     void Start()
  10.     {
  11.         anim = GetComponent<Animator>();
  12.     }
  13.  
  14.     void Update()
  15.     {
  16.         if(Input.GetKeyDown(KeyCode.F))
  17.         {
  18.             Attack();
  19.         }
  20.     }
  21.  
  22.     void Attack()
  23.     {
  24.         anim.SetTrigger("Attack");
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement