How exactly did you lose your motivation? What it the minute you completed your goal? If your entire reason for lifting/training was one short term goal then you have a deeper issue.
You need to figure out what that deeper issue is. While you are doing that set another short term goal so your training doesn’t suffer. Try to set one that is performance related tho like a PR on a lift.
BF% and achieving a certain weight gain/loss centers around looks which is superficial in a sense tho very important and relevent to what we do. The point is I believe that if you set and achieve a performance goal you will feel more of a sense of accomplishment.
plus if you are training hard but focusing on performance/PR’s looking better will be a direct side effect.