Multiple instance of an object with differnt Sprite and Audio

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By virk0009

Guys
I am new into Godot and loving it. I have an object with node Area2D, 2 children nodes sprite and collisionshape2D. Now when create instances of all these I want different sprite for all of them. This is how I have done this.

extends Area2D

export var AlphabetName = “SomeName”
export(Texture) var asset setget my_func

func my_func(tex):
asset = tex
if Engine.editor_hint:
get_node(“Sprite”).texture = asset

is this the right way or is there any better way to do it ?

Thanks