Search code examples
scopeinstanceunreal-engine4unreal-savegame

What does the 'C_#' after an instance mean?


quick question. So I've been working on saving my project, and I was doing some debugging 'cause things weren't functioning right. It seems fixed now, but I was wondering... After I promote the loaded game to a variable, I look at the return value, and at the end of the instance there's a 'C', underscore, then a number. The number is always incremented, so I'm wondering if I'm saving right. Should a save game instance always be the same, or does the number at the end increment each time you load from the slot?

ALSO, one other thing. How come after I cast to my save game object and get a variable, while I'm debugging it always says (Variable not in scope) when it IS getting the variable?


Solution

  • I assume your "loaded game" is a save game object, and I assume that you're testing in PIE. So you if you keep doing this then the game world is reconstructed over and over, so that the name of the loaded game object is being incremented. But if you close the editor then everything is restarted, also this incremented number (which is part of the object's name) is not saved in your save game unless you do it specifically. I mean you can get this name by dragging off from the object and call GetObjectName, and save it in save game object if you like.

    For the second question, in many cases Blueprint debugging is not functioning well (like in a function library), so no bother with that "not in scope" thing, the Blueprint is running fine, just that you can't see the value. In this case you have to use PrintString to see what you want to know.