Cast to the game mode? Do you mean to your own save game?
I’ve had problems using short slot names. Try making the name longer.
Cast to the game mode? Do you mean to your own save game?
I’ve had problems using short slot names. Try making the name longer.
until today i was able to cast savegame to the gamemode to save the variable “record” but after adding a new level and to use as entry screen (with its gamemode and player controller) the cast started failing, i have no idea what could cause that as im an absolute beginner but even after trying to set up the previous blueprints the cast failed anyway. I also tried to delete the savegame BP and recreate it thinking that it might have been a bug but when doing it it was the same ( bizzare thing, i couldn’t name it as the previous BP because an asset already had that name, weird).
The cast now fails in every BP independently, unluckly i havent copied the previous project so i’m stuck here
sorry, cast to savegame in the gamemode blueprint, even with longer slot name i have this problem.
It would be ideal to have a list of possible general causes why it fails the cast but i haven’t found one
I have the save file, what do you mean with 2) The object is not the right type? i don’t think i have changed it
Ok, I’ve figured it out, thank you. basically yes the save file was from the previous SaveGame BP, creating a new save game to slot made it. I still don’t understand why it didn’t work with the previous savegame but it doesn’t matter.
Thank you again
The only thing it can mean here is that when you saved ‘1’, it wasn’t of type SaveGame_G.
( it’s probably something to do with the weirdness with your save game, it might have the same name, but it’s not actually the same thing… )
The main cause for a cast failing is two things:
The reference is null
The object is not the right type
Do you have a save game under ‘1’. Have you looked in the folder?
( project name / saved / savegames )
Could be. The save game location is different for a packaged game ( distribution ). Then it’s
C:\Users\Username\AppData\Local\ProjectName\Saved\SaveGames
the problem comes again when i pack the project, might that be because i have a sav file somewhere in my pc that stops the cast from working? (i’ve already exported the project a few times so maybe that’s it)
i solved it by packing the project with a BP that created a slot with the same name as the first thing, then run the game with that BP and re-exported the original project with the sav file changed