コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        Vector3 movementPerFrame = playerMovement.GetMove() * playerMovement.moveSpeed * Time.deltaTime;

        Speed = (movementPerFrame.magnitude / Time.deltaTime) / 5; // Bodgy fix as max speed seems to be ~5;

        angle = Mathf.Atan2(playerMovement.GetX(), playerMovement.GetZ()) * 180 / Mathf.PI;
    }