Godot Version
v4.6.1.stable.official
Question
Invalid assignment of property or key ‘text’ with value of type ‘String’ on a base object of type ‘String’.
Getting this error in a fairly straightforward area of my code, haven’t run into many issues regarding labels, and not seeing the same example of “object of type ‘String’.”
The UI node is a Label, the scene exists at the time of calling the script below - just before updating the label I set up a progress bar in the same area.
Relevant code:
extends Control
@onready var questLbl = $(scene ref)
func _on_quest_btn_pressed() → void:
var questData = rmgr.GetQuest(charLv)
#set progress bar with quest time info
InitQuestLbl(questData[NUMREF.ONE])
func InitQuestLbl(output: String):
questLbl.text = output
---
func GetQuest(level: int):
#total time, quest text, reward type, reward amount
var questData = []
#get/set quest time
#get/set quest text string ***
#get/set reward type
#calculate reward amount
return questData
#***confirmed in debug this is pulling the expected test text string
Please let me know if I’m missing anything or should provide more details, but I believe this is every piece that touches the data before it errors when trying to set questLbl.text = output
