Forum begins after the advertisement:


[Part 8] There is a problem with downloading data.

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 8] There is a problem with downloading data.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14832

    Greetings to you. I ran into such a problem that when I add any edits to the save system, for example, I add a matching ability, when the game starts, the character does not work correctly, he cannot jump and the walking animation does not work. What could this be related to? The error indicates SaveData. https://drive.google.com/file/d/1cmb3MWIQYs5jccEya97FPh0uhEBc02JJ/view?usp=drive_link

    #14842
    Joseph Tang
    Moderator

    Thanks for bringing this to my attention, the issue with the code is that LoadPlayerData() is being called by PlayerController.cs on Start() but no data has been saved in SavePlayerData() to retrieve. this causes an error where the data is not loaded. As such, the rest of Start(), which contains your rb,gravityScale code, is not completed. Thus, your player cannot land on the ground and therefore cannot jump.

    This is easily fixed by saving your game at least once.

    However, considering you are just starting, What should work is that you can move your LoadPlayerData() code in PlayerController.cs to the bottom of Start(). You will still get the error message, but your game is still playable until you have saved.

    #14844

    Sorry, I’m using a translator, so I didn’t understand what needed to be added. I have already called the LoadPlayerData() function, I tried calling SavePlayerData() before the day to save data, but then saving at the bench stopped working. https://imgur.com/GVF0QnB

    #14846

    Thanks, everything worked out! I moved the SaveData function to the very bottom of the Start function.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: