I ran into a problem when packaging my project. I’m spawning actors from a class during the game. I do this using Trigger Volumes. I spawn the actors of the class in another volume. In the editor there is no issue with that, everything works fine. When I package the project I get some errors regarding the spawning of the actors.
LogScriptCore:Warning: Script Msg: Attempted to access index 2 from array Particles of length 2!
LogScript:Warning: UGameplayStatics::BeginSpawningActorFromClass: can not spawn an actor from a NULL class
I don’t know why this happens. One actor of each class is already placed in the scene at start.
I managed to find a solution!
The actors had different names, everytime they spawned. Not in the editor, but when packaging. Instead of working with the object names, I created a class and tested for the class and not the object names. The array wasn’t created so there were no objects in it so it was returning NULL.
Now it works fine