I am working on a maze game with a cube walking around, collecting keys, entering portals and dodging traps… The problem is the players find it hard to find the cube “face” at the beginning… This is because I am using this script for moving the cube:
if (Input.GetKey (KeyCode.UpArrow)) {
transform.Translate (Vector3.forward * moveSpeed * Time.deltaTime);
}
if (Input.GetKey (KeyCode.DownArrow)) {
transform.Translate (-Vector3.forward * moveSpeed * Time.deltaTime);
}
if (Input.GetKey (KeyCode.LeftArrow)) {
transform.Rotate (Vector3.up, -turnSpeed * Time.deltaTime);
}
if (Input.GetKey (KeyCode.RightArrow)) {
transform.Rotate (Vector3.up, turnSpeed * Time.deltaTime);
}
I want to make something like a smiley face or just put a different color on the “face” of the cube so that the players will know what direction they are facing when the game starts…
I don’t know how to do that… I was thinking to create a material and modify it and then apply it to my player cube… but I don’t know how to do that either… I have just started in unity and I have previous experience in scripting.
I already saw these:
However, the most interesting answer is this: