Godot Version
v4.2.1.stable.official [b09f793f5]
Question
Hi everyone.
I am trying to put together a path of an object and the name of that object in a string, but I get an error saying: Invalid operands ‘Object’ and ‘String’ in operator ‘+’.
What can I do?
I have already tried $“…/” + str(character_move_name)
It tells me that a node and a string cannot be joined together.
I imagine the solution must be easy once you know it, but I really don’t know how to concatenate the path string and the text string.
All the code below
func moves_character(positionTo: String, character_name : String):
var character_move_name = “char_” + character_name.to_lower()
var tween = get_tree().create_tween()
tween.set_ease(Tween.EASE_OUT)
tween.set_trans(Tween.TRANS_QUAD)
#Here below is the problem i dont understand
tween.tween_property($“…/” + character_move_name ,“position”,positions.get(positionTo),1)
pass