I have an array of struct pointers that’s in a header file;
TArray<MyStruct*> MyArray;
As soon as I start trying to use it, I get access violation reading location 0x000000…
Even just calling MyArray.Num(), It crashes the editor. Do I have to do something before using this type of array?
Thanks!
EDIT: This is even happening after I make it an array of structs, and make the array a UPROPERTY. And also comment out any other functions that could be trying to access it.
I tried that, doesnt work. I think i’ve done something wrong somewhere, the access violation depends on how its accessed. Loading it on start play seems to work fine. thanks- i’ll just step through everything i’ve done with the class.
It seems as if you can’t use the player controller to store gameplay data during run time. This array was in a class that inherited from playercontroller. I moved everything to the character classes and it works fine. If anyone knows why this would be or where it’s explained in the docs- please post a comment below, I’d be interested to know. Probably a noob mistake but I’m unclear as to why inheriting from a specific class would make such a basic operation difficult- they both inherit from actor…