Search Unity

[Simple, yet urgent] If I recieve input, send key.

Discussion in 'Scripting' started by sinnes, Dec 6, 2012.

  1. sinnes

    sinnes

    Joined:
    Oct 28, 2012
    Posts:
    2
    Hey, how do I achieve this?

    psuedo code:

    function Update () {
    if (Input.GetKey ("left"))
    Debug.Log("left arrow is pressed");
    sendkey("up");

    }

    Basically im trying to make the controller move both forward and the side at the same time when I press the left button. This will also apply to the right one.

    Any hints?

    Thanks alot!
     
  2. sinnes

    sinnes

    Joined:
    Oct 28, 2012
    Posts:
    2