//Jimmy Vegas Unity Tutorial //This script is for weapon mechanics using System.Collections; using System.Collections.Generic; using UnityEngine; public class WeaponMechanics : MonoBehaviour { public static bool isAiming = false; public GameObject thePlayer; public float horizontalMove; void Update() { if (Input.GetMouseButtonDown(1)) { isAiming = true; thePlayer.GetComponent().Play("Aiming1Pistol"); } if (Input.GetMouseButtonUp(1)) { isAiming = false; } if (isAiming == true) { if (Input.GetButton("Horizontal")) { horizontalMove = Input.GetAxis("Horizontal") * Time.deltaTime * 150; thePlayer.transform.Rotate(0, horizontalMove, 0); } } } }