I have a couple of questions about TArrays
How do I initialize a TArray ptr ?
TArray<AActor*>* Foo;
Right now I have
TArray<AActor*> Foo;
TArray<AActor*>* GetArray() { return &Foo; } //getter
How can I do it for :
TArray<AActor*>* Foo;
TArray<AActor*>* GetArray() { return Foo; } ///getter
//Over here the Foo ptr is always null and I get a crash to desktop
Also following up this question, Can I make a ptr to an array available in blueprints ?
For example, I have an array of interactable actors in my ACharacter class and it tracks a list of interactable actors that it can interact with if the player is within the trigger box area of that said object. Can I get this array in blueprints to display on my HUD (Blueprint Widget) or do a raycast and see if the player is looking at the interactable object and if exist in the list of interactable actors?
Example would be a door with a trigger box and the player can open/close it when inside that trigger box, If there is a note on the door, and I want to player to read that note on the door instead of opening or closing the door, I would like to trace what the player is looking at and determine the outcome of it.
Thanks for your time.