Autocompleting some strings should place a StringName literal instead of a normal string #6620
Closed
jaymehta-g
started this conversation in
Scripting
Replies: 1 comment
-
This is implemented as 2 editor settings (disabled by default) for future 4.3. See: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If I have
Input.is_action_pressed("ui_left")
running in
_process
then if I understand correctly, every single frame it is creating a new String object, comparing it to all currently held input keys letter by letter until it finds a match. But if I runInput.is_action_pressed(&"ui_left")
, then Godot turns the string into a reference to the same StringName object and every frame the line is much faster.
The problem is that when typing out this line, if I use the auto complete options in the dropdown that appears while I'm typing the name of the input axis, Godot inserts a normal string when it would make much more sense to insert a StringName and be more efficient.
Beta Was this translation helpful? Give feedback.
All reactions