using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class TappingBAll : MonoBehaviour

{

    public Vector3 moveVelocity;

    public float movePower = 6;

    float moveVelocityx = 1;

    float moveVelocityy = 1;


    void Movedd()// 플레이어가 왼쪽으로 이동하는 함수. 

    {

        moveVelocity = new Vector3(moveVelocityx, moveVelocityy, 0);


        transform.position += moveVelocity * movePower * Time.deltaTime;

        Debug.Log(transform.position);


    }

    void Update()

    {

        Movedd();// 플레이어가 왼쪽으로 이동하는 함수. 

        if (Input.GetKeyDown(KeyCode.UpArrow))

        {

            Turn();

        }

        

    }


    float Turn()

    {

        //Vector3 moveVelocity = Vector3.zero;

        this.moveVelocityx = Random.Range(-1.0f, 1.0f);

        this.moveVelocityy = Random.Range(-1.0f, 1.0f);


        return moveVelocityx;

        return moveVelocityy;

    }

}



일단 이동하다가 윗키를 누루면 랜덤하게 방향을 바꾸는 코드를 만들었는데 방향을 바꿀때마다 속도가 다 달라집니다.
어떻게 해결할까요?