+1 vote

What is the easiest way have GDScript evaluate a defined String as part of a component in another block of code?

To give a more clear explanation, I have a reference to a new definition I want to add to a Dictionary, and I know what the key is for the value (its set as a string). How can I use this to define the key, and then ultimately, the value? Do I need to use Eval somewhere?

Here's the code I have:

var InstanceAction = ""
var Dictionary = {}

Dictionary.InstanceAction = "Custom String"
in Engine by (62 points)

1 Answer

+1 vote
Best answer
Dictionary[InstanceAction] = "Custom String"
by (9,712 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.