I've been coding for probably about 2-3 years, inconsistently,
That is the source of your problem right there. The solution, since you lack some motivation and direction, is to increase your desire to work hard almost every day on coding and stick with a course or other plan which has been ready made for people like you.
Don't feel too bad, because this is very common for people to go thru a time in their life when their chosen occupation lacks their self-discipline. (Discipline really means training and not punishment.)
I recommend that you find a ready made plan somewhere to progress in coding. That might be a book, a long online video tutorial, work with game dev team project using a certain game engine, school course - whatever makes you stay on course and pace yourself.
Let's keep things as simple and clear as possible. You have the choice to get motivated and on a plan. Just stick with it!