using UnityEngine;
using System.Collections;
public class PlayerEmptyRotate : MonoBehaviour {
public float horizontalSpeed = 50.0F;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (!Input.GetKey (KeyCode.A) || !Input.GetKey (KeyCode.D) || !Input.GetKey (KeyCode.W) || !Input.GetKey (KeyCode.S))
{
float h = horizontalSpeed * Input.GetAxis ("Mouse X");
transform.Rotate (0, h, 0);
}
}
}
The above is the code where I was trying to start the function in the if statement when those mentioned keys are not pressed and stop when any one of those keys is pressed.