I have an OOP system that creates objects on the server. When I attempt to get these objects on the client using a remote, it returns the object but, none of the functions are defined and just return a nil error
is it possible to make the object replicate over to the client with the functions
No. Functions do not serialize and therefore cannot be send through remotes. Also, deep copies of your OOP objects are gonna be made, and metatables are not copied. Maybe don’t structure your code like this.
Why not fire all of the necessary data to the client and reconstruct the object with your constructor? Also, it would make the most sense that mutable data members have getter/setter methods in your module/class.
Yeah this is pretty much exactly how one of my current projects (not my code though) “replicates” OOP objects. The class is in ReplicatedStorage. Both the server and the client will require it and construct a version of the object on their end. Changes made on the server are communicated to the client.
It’s not a very fun experience to work with though. Wherever I can, I don’t replicate OOP classes. I always have it set up in such a way that I don’t need to replicate anything except pieces of information for other handlers, not for a similar instance on a different environment.