Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I haven't used Visual Basic in at least a decade so I don't remember, but in most languages I know the dot operator is only used to access member functions of the class or member variables of the object.

In GDScript, objects and dictionaries use C++ compiled functions in similar-ish ways to compiled languages, but it includes more steps as the data is evaluated and handled in realtime due to the lack of strict data typing. If the string after the dot operator doesn't correspond to any compiled preset then it is processed as a key for a lookup.

In compiled languages member variables of an object are accessed by converting the name into a memory offset from the starting memory address of the object. In GDScript, member variables are string keys used to access values in an internal dictionary, so the relative offsets of variables in memory are not constant. Compiled languages don't use complex lookups like dictionaries as a core part of their design, so I would only expect such a feature to exist in an interpreted scripting languages where convenience is more important than efficiency.

Edit: It might be time to start a new chain of posts as this one is getting quite deep and less convenient to find.