Sorry it’s my first time using Unity. If my question is too dumb or somewhere existed please easy on me.
I’m trying make some bomberman game on Unity. Camera will see it from top. And right now i’m only starting and trying make some movement. But on my current code, it’s moving directions i don’t want. For example, if you press W and D same time, it moving to top right corner. I still can’t decide what happen if player press W and D same time. It should go top or right? Also how I disable unwanted angle movements.
function Update () {
if(Input.GetKey("w")) {
transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
}
if(Input.GetKey("s")){
transform.Translate(Vector3.back * moveSpeed * Time.deltaTime);
}
if(Input.GetKey("d")) {
transform.position += transform.right * moveSpeed * Time.deltaTime;
}
if(Input.GetKey("a")) {
transform.position -= transform.right * moveSpeed * Time.deltaTime;
}
}
hm, you are right, i hate myself.
– thisizmonsterDo you know some bomberman or same game tutorial? I searched from youtube, found one bomberman but that's not on english. if you know, please give me link :)
– thisizmonster