- Home /
Ctrl key + hor/ver axis ?
Hi. I have problem with this:
if (Input.GetKey(KeyCode.LeftControl))
{
if (Input.GetAxis("Horizontal")<0) shoot(Dir.L);
else if (Input.GetAxis("Horizontal")>0) shoot(Dir.R);
else if (Input.GetAxis("Vertical")>0) shoot(Dir.U);
else if (Input.GetAxis("Vertical")<0) shoot(Dir.D);
}
else // normal move
{
if (Input.GetAxis("Horizontal")<0) move=Dir.L;
else if (Input.GetAxis("Horizontal")>0) move=Dir.R;
else if (Input.GetAxis("Vertical")>0) move=Dir.U;
else if (Input.GetAxis("Vertical")<0) move=Dir.D;
}
So. Moving work also with arrow keys and "wsad", but shooting only with arrows - wsad+ctrl don't work. Any ideas?
Comment
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
New Input axis with Numpad Keys 2 Answers
having trouble with "ctrl + number" 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
Input axes freeze from opposite input rather than cancel out! 1 Answer