Sharing state in a modular system

Hello. So I’m working on an advanced movement system. I want to encapsulate the code because each feature (sprint, air jumps, crouching, sliding, etc) is heavy on code. My problem is:

How do I share state between these modules so they don’t interfere with each other?

As a side note: I prefer not to use OOP.
Side note 2: Since movement is a pre-defined thing in Roblox, it can be hacky to get the conditions needed to enter certain states, which is why I didn’t settle on a basic state machine.

I feel like a shared module that is only read and written to would be fine but it feels rather hacky for some reason. Am I wrong? Is this a standard way of doing things? Thanks

Sounds completely normal and reasonable to me, at least that’s how I do stuff, one source for the related data, access it wherever you need it, totally expandable too.

shared module that holds just the state is what i do

you can make it less confusing with good type annotations

Thanks for the answers guys. I’ll just go with data modules then.

I agree with the above posters, that is how I do it. Might want to mark this as solved.