I’m having some trouble dealing with getAllActorsOfClass after packaging my project. I’ve been setting camera system based on this [tutorial ][1] (it has 4 parts, i followed all of them), and if in PlayInEditor everything works just fine, after packaging project and executing .exe, i has this in log:
LogScript: Warning: Script Msg: Attempted to access index 0 from array ‘CallFunc_GetAllActorsOfClass_OutActors’ of length 0 in ‘/Game/2DSideScrollerBP/Blueprints/2DSideScrollerCharacter.2DSideScrollerCharacter_C:ExecuteUbergraph_2DSideScrollerCharacter’!
How can i fix it and why does it even behave like that? All i need is to have reference on my custom camera actor inside my character as a variable. GetAllActorsOfClass node is in Set Camera Reference function belonging to character.
Ok, assuming it is just a weird packaging problem and not a BP thing, just try putting a copy of the camera somewhere in the map. You don’t use it, it just gets included in the map, which should force the packaging…
so i put the second bp_camera, and after playInEditor it caused red warnings (cause as a copy of bp_camera it has beginplay event and eventtick nodes too, i think). i packaged it, but still in .exe does not work as it should
also one of my friends has this project on his laptop and he has after packaging the same problem.
First figure out how big the project is, right click on the folder in the explorer and click properties.
Bear in mind you have to upload this somewhere like google docs or dropbox.
If you need to make the project smaller, then make a new project of the same kind and migrate ( right click in content browser ) only the necessary assets to the new project.
well, no, i haven’t been having any problems with crashes and, as far as i remember, I didn’t ‘force delete’. I will do as you advise then, otherwise I will get rid of the interface or return to the old camera systen. Thx for your help!
so i mad a new actor with the same bp code from into it and set things to use the new one, deleted the old one, now it works fine, but still, i has no idea why it wasn’t working previously.
thanks to ClockworkOcean!
I know this is an old thread but I found that if I copy a get all actors from other places and then try to reuse them for another actor unless I disconnect the entire thing and then compile it sometimes holds on to the previous actor and will not function and I will get consistent warnings about finding NONE when searching. If I recreate it and or what I describe above “CLEAN” it then it works fine.
I’ve never found that, but I have noticed that once an un-typed node gets its type ( like array operations ), they usually need replacing before you can use another variable sort. I’m assuming somehow this behavior makes it through to things like getallactors also.