Hey! Im making simple multiplayer test here.
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float Speed = 10;
// Dirty flag for checking if movement was made or not
public bool MovementDirty {get; set;}
void Start() {
MovementDirty = false;
}
void Update () {
// left right
float translation = Input.GetAxis("Horizontal");
if (translation != 0) {
this.transform.Translate(translation * Time.deltaTime * Speed, 0, 0);
MovementDirty = true;
}
// up down
float translation2 = Input.GetAxis("Vertical");
if (translation2 != 0) {
this.transform.Translate(0, translation * Time.deltaTime * Speed,0);
MovementDirty = true;
}
}
}
Left and right works fine.
Diagonal movement works fine too.
Up and down and sprite just stays in place no movement?