Object Oriented Programming Problem?

I am currently using a OOP module I made myself for my game. One of the properties in this “custom object” is named Crouching, and its a bool. I have experienced problems with it, but the real problem is, why does it work as soon as I change it to a physical BoolValue object instead of a regular bool?

Could you show the code?
That would help us…

1 Like

The problem isn’t in the code, it’s more of a system problem I’d like to find out about?

So how do you expect us to help you without the code?

Like I stated, it is not a code-wise problem. I am just wondering if OOP properties such as bools replicate slower than others. The code is not needed.

What do you mean?? I don’t get it… “OOP properties”???

OOP properties are the properties of a custom object, I should’ve worded it like that.

Still can’t figure out your question, It doesn’t replicates bools from a boolvalue, you’re reading the value you retrieved, or the Object.Value depends like this

self.Value = Object.Value – not going to change never.

self.Value = Object
print(self.Value.Value)

So, what exactly is the problem? You created a class called crouch?

I think it’s the system, there shouldn’t be a speed difference unless there is an external problem causing it.

1 Like

Yeah, that’s exactly what I thought. It does suck though, since now I have to adjust most of my game to use value objects instead of normal bools though.

You dont need to use userdata values. Do you have code that I can see? Also when you mean “OOP” do you mean Metatables, Proxys, UserData or what?

By OOP, I mean metatables. The code is straightforward, exactly as you’d expect too.

OOP stands for object oriented programming
@Sweet_Smoothies
Here’s the answer

Is that what you meant??

That is not the answer, I’m afraid. It is a system problem, not a coding problem.

Please let me see some code and I can tell you. All I do in lua is OOP scripting. I know metatables better than most.

So what’s the question???

What do you call a “Regular bool”???

I think the question is are you changing the bool directly or through a method?

His problem was that the datatype inside the code eg local bool = true was slower or didnt work as well as a local bool = Instance.new("BoolValue") bool.Value = true If I understood the question correctly.

I am changing it directly, am I supposed to use a method?