help me wit the code

4.4.1

i made a game called color swap in godot, its about the main character(player) that can change his color by pressing c and he can only stand on platforms that matches his color,every thing is working except for the changing color part and that the player cna only stand on his own color only,i didint make it since the swap color isnt even working) how can i make him change colors when the user presses c
the blue character is a scene and the red character is anothor scene

If your character sprite is white you may be able to use modulate to change colors, or you can replace the Texture or SpriteFrames resource depending on what Node type your character is.

func change_color(set_red: bool) -> void:
    if set_red:
        $Sprite2D.texture = load("res://red_player_texture.png")
        # probably also change collision_mask
    else:
        $Sprite2D.texture = load("res://blue_player_texture.png")

Could you post some of your code that isn’t working? Explain a little more about your scene set up?