Congrats on your new Line 6 equipment, the UX2 is very handy.
I record to Audacity from the UX2 all the time from the Gearbox software. Check that your computer's recording device is set to Line 6 Toneport UX2 and not to microphone or line in.
If that is all good maybe check the Audacity Edit/Preferences and also set the recording device to Digital Audio Interface Line 6.
After that, there's an Audacity latency correction you'll need to apply. Just check out some instructions on youtube to help get you squared away with that setup.
Good luck, hope you get it working out.
ecarr