Hello, I have a little problem here. The idea is that to have an area2d to detect player enter, then play a sound. So If I instance the area2d scene as a child of any node, the node will plays a sound once player enters.
The sounds are preload in a global AudioManager script, I first get the editor_description of the parent node. Then match the description to the sound in a list, then play the match name of the sound from the AudioManager. Things are fine until the last step that I can not seem to inject the variable of the name of the sound to the play function. It gives me a expected identifier as member error. Is that a correct way to input the name of sound into the script? Thank you.
var soundName = ""
soundName = get_parent().editor_description
if body.name == "Player":