How far should scripts be broken up and why?

I’m very new to coding and am trying to learn by watching tutorials.

many vids end up breaking down scripts and have:

a movement script
A health script
A stats script
An inventory script
A stat modifier script
An enemy movement script
An enemy health script
Etc etc.

I’m too new to scripting(1 week) to know how far to break things up or if I’m able to bring things together.

Entirely up to your choice. An excellent rule of thumb is “separation of concerns,” as outlined here:

Or you can do it all in one script and you’ll quickly develop a feel for how tangled that can get. It’s really something you have to get a feel for by doing it, doing it wrong, improving it, overdoing it, etc.

1 Like

I’ve been taught a sentence when I was way younger and learning programming : “programming is dividing big difficult problems into easy to solve little ones”.
With experience, I’ve learned that this is incredibly true and often, having a lot of little simple scripts is generally a good sign that my project is designed correctly. Often, making a chart is necessary to perform such division whilst remaining on topic.
For Unity I’d just recommend not to have to many different scripts running Update(). Keep in mind that Update is looping every frame, and as such it’s often better not to have gazillions scripts running in the same time.
To sum up, it’s a good healthy balance between separation of concerns and optimization.