Hello, I'm stucked for hours in this, I would like to ask your help!
So, I specified two genres, male and female, and each genre may have own customization, like hairs or clothes and things like that.
So this is how I programmed it:
Button Female:
extends Button
func _ready():
var SpriteNode = get_node("/root/World_test/Character/Gender") #note the gender in .../Gender , is a Sprite Node.
self.connect("pressed", SpriteNode, "change_gender", [get_name()])
Button Male has the same code than Button Female.
The code lead to the Kinematic Body in wich is a sprite with this script:
extends Sprite
Change Gender -------------------------------------------
var gender = "male"
func change_gender(name):
gender = name
set_texture(load("res://Sprites/%s.png" % gender))
pass
but now, I want programm a way to make each genre have it's ownt customization and for tests I'm first programming the hair that is a child node of the gender (sprite) node:
extends Sprite
Change Hair -------------------------------------
func change_hair(name):
set_texture(load("res://Sprites/Customization/Hair/Male/%s.png" % name))
pass
So how can I make each genre have its own type of hairs? I guess I need to find a way to import in the Hair node the var from the Genre node, but I've tryied it for hours and I couldn't do this...
Thank you!