Hi, I have a problem with save and load it didn’t work in my game, I want to save player position, so I have load button in the mainmenu and the save button in the pausedmenu, and this is my screen shoot for the events…
You haven’t answered my questions - the screen shots don’t show how you use the variables (PriestX and PriestY) nor do they show where are you setting the position of Priest using the variables.
You show the events reading the values and setting 2 variables with them, but nowhere can I see that the Priest’s position has been changed using those 2 variables.
The other 3 questions to answer are :
Keep in mind these questions weren’t just asked for the sake of it. It’s to work out where the problem might be. There are a few possible reasons, and we want to eliminate as many of them until we work out where the problem lies.
What I mean is how do you know the variables PriestX and PriestY have values. You can determine this a number of ways :
place a temporary text box on the screen and output the variable values to that.
run debug mode, and inspect the variables
in the event that reads to values in add the action to write it to console. Then run in debug and check the value that’s written out to the console area.
The other thing to do is make sure the read action is executed. In the event where the values are read in, add a temporary event to change the colour (tint) of one of the on-screen objects (say the red-heads to “0;0;255”) . If it changes colour, then you know the actions are being hit. If it doesn’t change colour, then the event conditions are not being met.
You can inspect the priest object and check it’s position, and ensure it’s the same as the saved values after you clicked load.
BTW, are you doing anything else whe the load button has been pressed? You’re not reloading the scene by any chance?