There’s already a setting for that! Go to Settings → Touch → Movement and camera and turn off “Floating stick”, then the joystick stays in one place