Shop system not working[solved]

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

Hi guys,so I am just a new developer and I got stuck with a problem from a long time
Problem - I have a shop system in my game and put this code in it to change players skin when checkbox is pressed but this is not working please anyone help me I will be so much greatful

Code - _func_on_skin2checkbox_pressed:
Preload(player).skin1.hide()
Preload(player).skin2.show()

:bust_in_silhouette: Reply From: Pomelo

First of all, you are not telling us what it is that is not working. In this case I can tell that you are trying to preload something while not providing a path. What you need to do, assuming skin is a child of player, is either get a reference of the player node, or, send a signal to the player to let him manage the hiding and showing of the skins. To get a reference of the player you need to use methods like get_node()