SOLVED
Code: Select all
get()
Code: Select all
set("your_string", value)
Code: Select all
get("your_string")
Code: Select all
var myVars = {"string1": "John Doe", "string2": 101}
Code: Select all
myVars.string1
...or...
myVars["string1"]
var v1 = "v2"stayathomedev wrote: ↑Tue Jul 18, 2023 2:37 am What are you attempting to do in the script? GdScript?
You can always set a variable to equal another variable if they are the same type.
Code: Select all
var v1 = "string"
var v2 = v1 # v2 = "string"
Some folks have mentioned dictionaries and `get` already, but I'd like to take a different approach to help you.K29 wrote: ↑Tue Jul 18, 2023 10:41 pmvar v1 = "v2"stayathomedev wrote: ↑Tue Jul 18, 2023 2:37 am What are you attempting to do in the script? GdScript?
var v2
some how use v1 to refrence v2
it does when you use dictionaries, and if i'm not mistaken, they work for arrays aswellOwen Lloyd wrote: ↑Wed Jul 19, 2023 5:32 pm Interesting question. That sounds like using pointers, by ref, etc.
Does gdscript provide a way to use pointers?