キャラクターの移動方向に向きを変えるようにしたいんだけどこれだと向きは変わるんだけど移動が変になる
原因分かる人教えてくれませんか
float horizontal = Input.GetAxis("Horizontal");
transform.Translate (Vector3.right * Speed * horizontal * Time.deltaTime);

float vertical = Input.GetAxis("Vertical");
transform.Translate (Vector3.forward * Speed * vertical * Time.deltaTime);
direction.x = horizontal;
direction.y = 0;
direction.z = vertical;
transform.LookAt (transform.position + direction);