Hi thanks for the help.
I added it after my Set’s but to no avail.
However - i do get some new interesting warnings in my log now.
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogUObjectGlobals: Warning: Failed to find object 'Object None.None'
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
LogScript: Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
Not sure as to why it would say it’s a null class when i print the class name succesfully during gameplay.
So it does save, but it just doesn’t load correctly probably due to some faulty code on my end.
You probably can’t save actor references in a save game. We did our save system (4.23) by storing the actors transform and the actors class and spawn them on loading. If you have actors placed in your level (not spawned by player) I would do the same but instead of spawning new actors I would box-trace to get the right actor reference (your ActorList). Hope that helps.
Instead of saving an array of actor references, you need to save an array of class references. You can convert the actor reference by using the GetClass or GetObjectClass function.
Then when you load your save game, use the SpawnActorOfClass function and plug in your class reference and transform
You can save actor ref, its just you can’t do anything with it. You can’t save transform or any other data. It will just point to the actor in your map. You can destroy actors and move them and get values, but they will be the current actor values and they will go back after playing again. Every level has an Actor Array which is populated on construct and I think it points to that.