There's almost nothing on the ready() just setting a random rotationspeed i use to rotate the sprite after. Almost all the code is in the _process function. Basically it spins the sprite and scale it while turning it visibility down:
func _process(delta):
rotation += rotarion_speed * delta
scale += scale * delta
var color = get_modulate()
color.a -= delta
set_modulate(color)
and it has a timer, called LifeTimer that kills it after 3s:
func _on_LifeTime_timeout():
queue_free()
As I set the sprite every time in my character _process function after duplicate the empty sprite, every sprite has different texture but all share the same state. it is something like this:
var sprite= get_node('Sprite').duplicate()
sprite.set_texture(sprite_texture[randi() % sprite_texture.size()])
sprite.set_position(get_node('SpriteSpawn').get_global_position())
sprite.get_node('LifeTime').start()
get_parent().add_child(sprite)
Even when I do setprocess(false) in the _ready of the sprite script and setprocess(true) after the duplicate() they all start with the same alpha the previous one has at the moment, the same rotation and scale, and when the duplicate is queued free. My code broke because the original node sprite is queued free too. And godot debug says i'm trying to duplicate a null reference, or something like that.
I'm asking if there is a way to create a fresh instance of the node, because how similar the nodes are to objects. But I have a feeling an initiated node is pretty much like an instantiated object in python and all I can do is referencing it, and non initiated referenced packedscenes are the way to have a class like method to initiate a new node 'object'. It's that a right assumption?