20/02/24 20:37:54.32 A6C4ojr1.net
>>671
これで規定通りの動きができた
public class Cube_Move : MonoBehaviour
{
void Update()
{
//左に移動
if (Input.GetKey(KeyCode.LeftArrow))
{
this.transform.Translate(-0.1f, 0.0f, 0.0f);
}
//右に移動
if (Input.GetKey(KeyCode.RightArrow))
{
this.transform.Translate(0.1f, 0.0f, 0.0f);
}
//上に移動
if (Input.GetKey(KeyCode.UpArrow))
{
this.transform.Translate(0.0f, 0.1f, 0.0f);
}
//下に移動
if (Input.GetKey(KeyCode.DownArrow))
{
this.transform.Translate(0.0f, -0.1f, 0.0f);
}
}
}