Serial communication in touchdesigner working with Uno but not with Mega

The code also compiles and uploads fine on the mega. However, serial communication with Touch Designer specifically doesn't work. It does work when I try to communicate via the serial monitor.

The Uno recieves the bytes Touch Designer is sending, while the Mega (with the same sketch) doesn't.