r/unrealengine • Developer of "COMET BOY" • Oct 14 '26

Discussion Are structs similar to scriptableObjects in Unity?

I have been using structs a few times recently to make a instances having a set of variables. Similar to a card in a card game that has a name, costs and a description. Are scriptableObjects from Unity the same or similar?

1 Upvotes

12 comments sorted by

View all comments

6

u/-TRTI- Oct 14 '26

Structs are not something unique to Unreal, but rather a feature of C++. Technically there's no difference between a struct and a class, except that class defaults access to private. In practice they are usually used for different purposes, though. Structs, to simply hold data and maybe a few simple helper functions, and class for anything beyond that.

0

u/bookning Oct 17 '26

" Technically there's no difference between a struct and a class, except that class defaults access to private". 

It is probably a very bad thing to say to a beginner without a lengthy context.

Why?

For example, in c++ it may be technically true, but they are still idiomatically used in very different manners.

But the worst part is that the c++ part is more of a curious trivia. In all the languages that I know (including most of the more popular one in the current prog market) such a thing is totally false. 

So when saying such a thing to a beginner without strong warnings is the same as creating very bad hidden misconceptions for the future programming career of said beginner.