Answers for "How to make the player move multiple directions on specific rotations?"
http://answers.unity.com/questions/471301/how-to-make-the-player-move-multiple-directions-on.html
The latest answers for the question "How to make the player move multiple directions on specific rotations?"Answer by robertbu
http://answers.unity.com/answers/471358/view.html
With coding, you must code what you want to happen. Quaternion.Euler() sets absolute angles. Nothing here will give you an angle between the two. In addition, GetKeyDown() only returns true for a single frame. So even if this code were to somehow do a middle angle, the likelihood that you would get both key presses in a single frame is small. Here is a bit of a rewrite of your code in the direction you may want:
function Update() {
var myTransform = transform;
if(Input.GetKey("a")) {
if (Input.GetKey("w"))
myTransform.rotation = Quaternion.Euler(0, 45, 0);
else if (Input.GetKey("s"))
myTransform.rotation = Quaternion.Euler(0, 315, 0);
else
myTransform.rotation = Quaternion.Euler(0, 0, 0);
}
else if(Input.GetKey("w")) {
if (Input.GetKey("d"))
myTransform.rotation = Quaternion.Euler(0, 135, 0);
else
myTransform.rotation = Quaternion.Euler(0, 90, 0);
}
else if(Input.GetKey("d")) {
if (Input.GetKey("s"))
myTransform.rotation = Quaternion.Euler(0, 225, 0);
else
myTransform.rotation = Quaternion.Euler(0, 180, 0);
}
else if(Input.GetKey("s")) {
myTransform.rotation = Quaternion.Euler(0, 270, 0);
}
}Sun, 09 Jun 2013 02:34:27 GMTrobertbu