cant play fortnite with a controller

i recently bough a xbox wired controller, and it wont let me play a game with it plugged in, it always says there has been an error. please help!