Hi every one I have to try this code of keyboard I need to using GUI Button instead of keyboard See my code ,I already try to use but doesn’t work any more Pls help me.
Cheers!
private var axisH: float = 0;
private var axisV: float = 0;
function InputGetAxis(axis: String): float {
var v = Input.GetAxis(axis);
if (Mathf.Abs(v) > 0.005) return v;
if (axis=="Horizontal") return axisH;
if (axis=="Vertical") return axisV;
}
function OnGUI(){
axisV = axisH = 0;
if (GUI.RepeatButton(Rect(50, 10, 40, 40), "W")) axisV = 1;
if (GUI.RepeatButton(Rect(50, 90, 40, 40), "S")) axisV = -1;
if (GUI.RepeatButton(Rect(10, 50, 40, 40), "A")) axisH = -1;
if (GUI.RepeatButton(Rect(90, 50, 40, 40), "D")) axisH = 1;
}