![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ITSgaLYXI |
export var plant: String
onready var g = get_node("/root/g")
func _ready():
$Sprite.texture = load("res://src/assets/seedpackets/"+plant+".png")
$Label.text = g.plant_stats.plant.SunCost
Invalid get index ‘plant’ (on base: ‘Dictionary’).
Unrelated side note: You should rename “g” to something human readable and descriptive. If in doubt, avoid abbreviating variable - It will make you a better coder and help yourself and others that read the code to know what it is without needing to “look it up”.
ivanskodje | 2022-04-24 08:16