R

Sprites not changing in game after selecting a new one in pause menu

Roby1kenoby

Hello there.

I think this is partially mi fault, since i've decided to not load a .tres file for the players via script, but instead set them in the inspector,

The title say it all, the code run smoothly, everything works, but not the sprite change.

I can't understand where the issue is, and i'm not sure how to debug it.

Can someone help me understand?

Thank you!

Here's the project

https://drive.google.com/file/d/1Vk1cBYbeYb0k-yJPW3D9QhOGeWj4MOVK/view?usp=sharing


  • a
    andrewjhaugen replied

    Hi Roby! I want to help you out with this but I don't seem to have access to that Google Drive link you posted. Maybe try to make it public and then follow up with me so I can poke around and troubleshoot for you.
    Andrew

  • R
    Roby1kenoby replied

    I'm sorry!
    I've changed the access policy, it should be ok now!

    https://drive.google.com/file/d/1Vk1cBYbeYb0k-yJPW3D9QhOGeWj4MOVK/view?usp=sharing


    Thank you!



    1 love
  • a
    andrewjhaugen replied

    Sorry to bother you again Roby, but I need a project folder that has a project.godot file in its root directory. you may have to zip up the your entire project for meRoot.png

    like this
    Capture.png

  • R
    Roby1kenoby replied

    I'm very sorry, didn't want to upload a bigger file, tought the one i've uploaded could be fine.

    https://drive.google.com/file/d/1DCX_vnJ-uifgMj-H_9ECimmqAHfF5o0i/view?usp=sharing


    here is all the project folder!


  • a
    andrewjhaugen replied

    After digging into your project a bit, I do think your initial instinct was correct. The problem is stemming from the choice to not load player settings as a .tres file via script. Not to say that what you did was inherently wrong or anything! It's just that the rest of the setup assumes that you are loading settings dynamically with the tres files. You can see in the Remote Tree while running your game that the sprites on the PlayerCharacter Instance that are part of the Customization Menu are being updated, but the sprites that are part of the PlayerCharacterInstance that is running the obstacle course are not updated.

    In the UICustomizeCharacter script we have this line here in the _on_hands_option_changed method that says

    selected_player.pSettings.hand_texture = load(texture_path) 

    This is where the hand sprite change is happening, but since the resource that your in game PlayerCharacter is using doesn't seem to be able to update dynamically. the change is not propagating. If you wanted to stick with not loading the settings via resource you would need to come up with a solution to tell the PlayerCharacter's that their handsprite changed.