コード例 #1
0
    void MoveOnGround()
    {
        // キーの取得
        float _vInput = iController.GetMoveVertical();
        float _hInput = iController.GetMoveHorizontal();

        // 方向の取得
        Vector3 _vf = stat.myCamDirection * Vector3.forward * _vInput;
        Vector3 _vr = stat.myCamDirection * Vector3.right * _hInput;
        Vector3 _v  = _vf + _vr;

        _v.y          = 0F;
        moveDirection = _v.normalized;

        // 方向の変更
        this.transform.LookAt(moveDirection + this.transform.position);
    }