Hi, I'm new to Godot and coding in general. I'm following a tutorial for a simple plattformer and it throws this error when running my scene: Invalid get index of type 'String' (on base: 'Dictionary').
this is the code where it throws an error:
extends Area2D
signal picked_up
var textures = {"cherry": "res://jungle_jump_assets/sprites/cherry.png", "gem": "res://jungle_jump_assets/sprites/gem.png"}
func init(type, _position):
$Sprite2D.texture = load(textures[type])
position = _position
func _on_body_entered(body: Node2D) -> void:
picked_up.emit()
queue_free()
Thanks to anyone who can help me.