CharacterMovement.LocalMovement C# (CSharp) Method

LocalMovement() private method

Constructs a vector representing our movement local to our lookDirection, which is controlled by the camera
private LocalMovement ( ) : Vector3
return Vector3
    private Vector3 LocalMovement()
    {
        Vector3 right = Vector3.Cross(controller.up, lookDirection);

        Vector3 local = Vector3.zero;

        if (input.currentInput.inputHorizontal != 0)
        {
            local += right * input.currentInput.getInputHorizontal();
        }

        if (input.currentInput.inputVertical != 0)
        {
            local += lookDirection * input.currentInput.getInputVertical();
        }

        return local.normalized;
    }