You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since objects, arrays and dictionaries are passed by reference, constants are "flat". This means that if you declare a constant array or dictionary, it can still be modified afterwards. They can't be reassigned with another value though.
Steps to reproduce
Create an gd script
Define a const dictionary with some initial values
Try to change those values
Error
Minimal reproduction project
See reproduction steps
The text was updated successfully, but these errors were encountered:
Godot version
4.0-beta12_win64
System information
Windows 10, 64 Bit
Issue description
The following code throws an error "Cannot assign a new value to a constant."
In Godot 3 this worked and i used it mainly for singletons. So i depend on it.
According to the documentation this should work.
Link: https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/gdscript_basics.html
Statement:
Steps to reproduce
Minimal reproduction project
See reproduction steps
The text was updated successfully, but these errors were encountered: