Im trying to teach myself unity at the moment and i want to make a small 2D sidescroller in C# rather then javascript. Ive already done a few tutorials in XNA and i was just wondering how would i make a object to move with the keyboard?
I already know in XNA its
private void handleKeyboardInput(KeyboardState keyState)
{
if(keyState.IsKeyDown(Keys.up))
{
playerSprite.Velocity += new Vector2(0. -1);
}
}
and in unity javascript its something like this
function Update()
{
if(Input.GetKey(KeyCode.UpArrpw))
{
currentState = shipState.MOVINGUP;
ActionShip(currentState);
}
}
Can anyone give me some tips because im a bit unsure on what to do?
Thanks

New Topic/Question
Reply



MultiQuote




|