Variable["member"] vs variable.member

For those who noticed the switch, it turns out you can use either something like this

variable[“member”]

or

variable.member

fairly interchangeably in GDScript (as far as I can see - please correct me if I’m wrong) for accessing dictionary members. In fact, the behavior even seems to be identical if the member field doesn’t exist.

So go with whichever works better for you! :smile:

1 Like

Privacy & Terms