Godot Version
4.6
Question
Hello folks! I come to you with my head hung low because I have admitted defeat over figuring this out on my own through rampant googling, countless video tutorials, and banging my head against the code until it worked. I am testing my resolve towards making my dream game by just putting together the character creator menu first. Think cute little farming game a la stardew valley, but a fantasy horse sim. It’s my first time ever trying to make a game, and I’ve only been learning Godot a few days now, so there’s definitely a lot I don’t know.
I’ve gotten a lot done so far and I’m quite happy with it! The issue comes with my attempts at integrating a body selector. Its been pretty hard to find tutorials or really any information online at all about how to go about this so I was just going to try my hand at making two separate character nodes that were pretty much clones of each other with some slight name changes in their scripts, and have the selector buttons toggle hide/show for the respective models.
Issue is…. this.
(This is not at all the final aesthetic I’m aiming for, I just want to tackle getting it to work before I spend time to make it pretty.)
I don’t know what did it. Or why the hair color selector is coloring the first model’s shirt instead, considering the randomizer button does color their hair otherwise. I’ve since realized it was collision issues causing the displacement but the color picking still baffles me.
The model scripts are identical except for class names and sprite files. The only other thing I adjusted when I brought the second model in was this
@onready var _playerone: playerone = $player # previously in the script, for the smaller model
@onready var _playertwo: playertwo = $player2 # new code, for the bigger model
[...]
func _on_color_changed(skin_tone: String):
_playerone.change_skin_tone(skin_tone)
_playertwo.change_skin_tone(skin_tone)
func _on_eye_color_changed(eye_color: Color):
_playerone.change_eye_color(eye_color)
_playertwo.change_eye_color(eye_color)
func _on_hair_color_changed(hair_color: Color):
_playerone.change_hair_color(hair_color)
_playertwo.change_hair_color(hair_color)
func _on_hair_changed(hair: String):
_playerone.swap_hair(hair)
_playertwo.swap_hair(hair)
func _on_tops_changed(top: String):
_playerone.swap_top(top)
_playertwo.swap_top(top)
func _on_bottoms_changed(bottom: String):
_playerone.swap_bottom(bottom)
_playertwo.swap_bottom(bottom)