I attach this script to an object and add a collider.
Once I click the object and it will print “clicked”.
If I hold down the A key or any key for that matter it doesnt respond.
Can anyone test this code and tell me if it is just my system. Because I had something similar working before.
Thanks
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class buttonstuff : MonoBehaviour {
// Use this for initialization
void Start () {
}
void OnMouseDown()
{
print("clicked");
if(Input.GetKey(KeyCode.A))
{
print("clicked A");
}
}
// Update is called once per frame
void Update () {
}
}