Hi guys im new to the developer community

how can i share variables using an interface thank u

You can share variables by putting them somewhere all the sharer’s can access them.

Depending on circumstances, that may involve interfaces; but your question seems to imply you believe interfaces are a means to share variables, which they are not.

So I would advise you to forgot about interfaces for now.
Learn to walk first.

You can pass the object itself through a interface, but for variables youd have to do cast to and then pull the variable, this can be resource intensive as its always loaded so keep that in mind if your doing it frequently, id recommend watching a couple tutorials to find better ways to do it than that tho, perhaps i can show more later, in just on phone rn

You can put variables in your Game Instance and Get/Set them from anywhere. (Multiplayer is more complex)

But as @Nightwolf mentions it may not be the best solution to do this, and mostly is only used for loading and saving variables but in a user-friendly way, it makes communication easy for a beginner.

But, to answer your question specifically, here’s a helpful video:

1 Like