# \#tarray

**URL:** https://forums.unrealengine.com/tag/tarray/1617.md

[Latest](https://forums.unrealengine.com/latest.md) · [Categories](https://forums.unrealengine.com/categories.md) · [Tags](https://forums.unrealengine.com/tags.md)

---

## [\[Replicating TArray of UObjects\] Cannot get TArray\<UItemObject\*\> to replicate from within custom ActorComponent.](https://forums.unrealengine.com/t/replicating-tarray-of-uobjects-cannot-get-tarray-uitemobject-to-replicate-from-within-custom-actorcomponent/1262941)

<div class="topic-metadata">

**Author:** [@Jacob\_Odell](https://forums.unrealengine.com/u/Jacob_Odell)\
**Replies:** 7\
**Last updated:** [October 20, 2026, 7:07pm UTC](https://forums.unrealengine.com/t/replicating-tarray-of-uobjects-cannot-get-tarray-uitemobject-to-replicate-from-within-custom-actorcomponent/1262941 "2026-10-20T19:07:25Z")

</div>

Hello, I’m having an issue with getting a TArray of custom ItemObjects to replicate after the initial client load (it does when a client loads, but does not replicate after that). I am successfully adding ItemObjects to…

---

## [Only the values of TArray elements are not displayed in the Visual Studio Debugger](https://forums.unrealengine.com/t/only-the-values-of-tarray-elements-are-not-displayed-in-the-visual-studio-debugger/487839)

<div class="topic-metadata">

**Author:** [@iiiaiaa](https://forums.unrealengine.com/u/iiiaiaa)\
**Replies:** 4\
**Last updated:** [August 2, 2025, 2:22pm UTC](https://forums.unrealengine.com/t/only-the-values-of-tarray-elements-are-not-displayed-in-the-visual-studio-debugger/487839 "2025-08-02T14:22:42Z")

</div>

As you can see in the image, we have just added an element to the TArray of type int32, but we cannot see the value of the element in the debugger. There is probably no problem in allocating memory, and I can actually ge…

---

## [TArray of TSharedRef validity](https://forums.unrealengine.com/t/tarray-of-tsharedref-validity/2500896)

<div class="topic-metadata">

**Author:** [@SuiteLored](https://forums.unrealengine.com/u/SuiteLored)\
**Replies:** 5\
**Last updated:** [May 12, 2025, 12:48pm UTC](https://forums.unrealengine.com/t/tarray-of-tsharedref-validity/2500896 "2025-05-12T12:48:01Z")

</div>

Hello. Would as of 4.27 a TArray of TSharedRef automatically reflect referenced objects being destroyed by reducing number of elements or produce errors instead? as in, if I made an array of shared references and itera…

---

## [TArray elements editable in editor never gonna happen?](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939)

<div class="topic-metadata">

**Author:** [@OmicronNEGA](https://forums.unrealengine.com/u/OmicronNEGA)\
**Replies:** 8\
**Last updated:** [November 20, 2024, 4:16pm UTC](https://forums.unrealengine.com/t/tarray-elements-editable-in-editor-never-gonna-happen/349939 "2024-11-20T16:16:01Z")

</div>

Firstly, this is not a duplicated question. I have a class member TArray\<USceneComponent\*\> ActorsOnEachNote; I created some USceneComponent instances and added to this array. Then I want to edit these instance in edi…

---

## [Costless transfer of a std::vector\<T\>'s data to a TArray\<T\>.](https://forums.unrealengine.com/t/costless-transfer-of-a-std-vector-t-s-data-to-a-tarray-t/2124316)

<div class="topic-metadata">

**Author:** [@OctoberIC](https://forums.unrealengine.com/u/OctoberIC)\
**Replies:** 0\
**Last updated:** [November 15, 2024, 9:54am UTC](https://forums.unrealengine.com/t/costless-transfer-of-a-std-vector-t-s-data-to-a-tarray-t/2124316 "2024-11-15T09:54:51Z")

</div>

When working with external libraries, one often has to cast from C++ types to Unreal Engine types with the exact same binary representation. Here for instance, boost::geometry’s point\_xy and FVector2D. I don’t see why th…

---

## [How can I create a TArray\<const struct\> ? (It won't compile)](https://forums.unrealengine.com/t/how-can-i-create-a-tarray-const-struct-it-wont-compile/2071890)

<div class="topic-metadata">

**Author:** [@andyvyking](https://forums.unrealengine.com/u/andyvyking)\
**Replies:** 5\
**Last updated:** [October 22, 2024, 6:39pm UTC](https://forums.unrealengine.com/t/how-can-i-create-a-tarray-const-struct-it-wont-compile/2071890 "2024-10-22T18:39:47Z")

</div>

I want to create a TArray of const structs, but the compiler is failing on my Add() calls. Sample code: USTRUCT(BlueprintType) struct MULTIPLAYERSESSIONS\_API FMultiplayerSessionsSearchResult { GENERATED\_BODY() FMult…

---

## [Is there a built-in Epic Games solution to foreach TArray objects and call a function on them](https://forums.unrealengine.com/t/is-there-a-built-in-epic-games-solution-to-foreach-tarray-objects-and-call-a-function-on-them/1794149)

<div class="topic-metadata">

**Author:** [@gazee\_puk](https://forums.unrealengine.com/u/gazee_puk)\
**Replies:** 0\
**Last updated:** [April 8, 2024, 3:24pm UTC](https://forums.unrealengine.com/t/is-there-a-built-in-epic-games-solution-to-foreach-tarray-objects-and-call-a-function-on-them/1794149 "2024-04-08T15:24:27Z")

</div>

Hi, I was looking for a Epic Games method to foreach elements of a TArray container and call a specific function on them, but i can’t find one for TArray type. There are some similar functions such as ForEachObjectWithOu…

---

## [TArray\<FColor\> backed by shared memory](https://forums.unrealengine.com/t/tarray-fcolor-backed-by-shared-memory/1764870)

<div class="topic-metadata">

**Author:** [@IAmNoBody2we](https://forums.unrealengine.com/u/IAmNoBody2we)\
**Replies:** 0\
**Last updated:** [March 21, 2024, 10:56am UTC](https://forums.unrealengine.com/t/tarray-fcolor-backed-by-shared-memory/1764870 "2024-03-21T10:56:46Z")

</div>

Hello I have the following code, it works well. TArray\<FColor\> PixelBuffer; RenderTargetResource-\>ReadPixels(PixelBuffer); // call a C API from .dll written in Rust. SendFrameFunc(PixelBuffer.Get…

---

## [STL within headers of third party library in UE5](https://forums.unrealengine.com/t/stl-within-headers-of-third-party-library-in-ue5/1315472)

<div class="topic-metadata">

**Author:** [@Ediolot](https://forums.unrealengine.com/u/Ediolot)\
**Replies:** 1\
**Last updated:** [March 20, 2024, 6:03am UTC](https://forums.unrealengine.com/t/stl-within-headers-of-third-party-library-in-ue5/1315472 "2024-03-20T06:03:00Z")

</div>

Hello ! I have been reading some posts regarding the use of STL vector and other containers and I have seen that it is generally unsafe to use them inside UE5. However, if you where to use a third party library inside …

---

## [Struct recursion via Arrays - unsupported, but why?](https://forums.unrealengine.com/t/struct-recursion-via-arrays-unsupported-but-why/370035)

<div class="topic-metadata">

**Author:** [@gryzly123](https://forums.unrealengine.com/u/gryzly123)\
**Replies:** 4\
**Last updated:** [March 19, 2024, 3:00pm UTC](https://forums.unrealengine.com/t/struct-recursion-via-arrays-unsupported-but-why/370035 "2024-03-19T15:00:25Z")

</div>

You can’t create an instance of a structure inside that very structure, it’s completely understandable, as such action would fill the entire memory recursively upon object creation. However you also can’t create an arra…

---

## [Difficulties with SweepMultiByChannel and storing pointers to hit actors.](https://forums.unrealengine.com/t/difficulties-with-sweepmultibychannel-and-storing-pointers-to-hit-actors/1675070)

<div class="topic-metadata">

**Author:** [@TheoRat3](https://forums.unrealengine.com/u/TheoRat3)\
**Replies:** 11\
**Last updated:** [February 9, 2024, 10:43pm UTC](https://forums.unrealengine.com/t/difficulties-with-sweepmultibychannel-and-storing-pointers-to-hit-actors/1675070 "2024-02-09T22:43:52Z")

</div>

I’m working on creating an ability that applies a status effect to enemies in the form of attaching actors of a class I made “WeakPoint” to their meshes. I ran into a wall today when trying to apply this ability to an in…

---

## [How to sort TArray in c++?](https://forums.unrealengine.com/t/how-to-sort-tarray-in-c/465585)

<div class="topic-metadata">

**Author:** [@YanDaik](https://forums.unrealengine.com/u/YanDaik)\
**Replies:** 10\
**Last updated:** [October 3, 2023, 5:16am UTC](https://forums.unrealengine.com/t/how-to-sort-tarray-in-c/465585 "2023-10-03T05:16:58Z")

</div>

If i have an array of pointers: TArray\<OfClassPointers\*\> TheArray; I cant do like this : TheArray.Sort(\[\](const OfClassPointers& ip1, const OfClassPointers& ip2) { return ip1.level \< ip2.level; // or ip1-\> or…

---

## [Why is my multidimensional array implementation crashing on Init?](https://forums.unrealengine.com/t/why-is-my-multidimensional-array-implementation-crashing-on-init/283656)

<div class="topic-metadata">

**Author:** [@xlar8or](https://forums.unrealengine.com/u/xlar8or)\
**Replies:** 6\
**Last updated:** [August 7, 2023, 3:53pm UTC](https://forums.unrealengine.com/t/why-is-my-multidimensional-array-implementation-crashing-on-init/283656 "2023-08-07T15:53:50Z")

</div>

Hello, i’m making my custom 2D Array implementation and i’m using the following code: template \<typename T\> class TArray2D { TArray\<TArray\<T\>\> Array; uint32 Rows; uint32 Columns; public: void Init(uint32 Rows, ui…

---

## [TArray of EditInlineNew subobjects that is Instanced does not hold references when a member of native subobject](https://forums.unrealengine.com/t/tarray-of-editinlinenew-subobjects-that-is-instanced-does-not-hold-references-when-a-member-of-native-subobject/304512)

<div class="topic-metadata">

**Author:** [@anon26705860](https://forums.unrealengine.com/u/anon26705860)\
**Replies:** 13\
**Last updated:** [April 8, 2023, 12:12pm UTC](https://forums.unrealengine.com/t/tarray-of-editinlinenew-subobjects-that-is-instanced-does-not-hold-references-when-a-member-of-native-subobject/304512 "2023-04-08T12:12:30Z")

</div>

This is a slight duplicate post but the title is more specific than the other’s here and here. The easiest repro steps : Create a native AIPerceptionComponent on an AIcontroller in C++. Try to add items to the SensesC…

---

## [RemoveAll from TArray with GameplayTag](https://forums.unrealengine.com/t/removeall-from-tarray-with-gameplaytag/785823)

<div class="topic-metadata">

**Author:** [@PirikitoBunito](https://forums.unrealengine.com/u/PirikitoBunito)\
**Replies:** 4\
**Last updated:** [March 9, 2023, 5:50pm UTC](https://forums.unrealengine.com/t/removeall-from-tarray-with-gameplaytag/785823 "2023-03-09T17:50:10Z")

</div>

Hi, I’m trying to filter out actors from my TArray based on their GameplayTag. Actors don’t implement the GameplayTag interface on their own so I’m casting them to my BaseGameplayTagActor which just adds this feature t…

---

## [How can i convert a array to a structure](https://forums.unrealengine.com/t/how-can-i-convert-a-array-to-a-structure/741274)

<div class="topic-metadata">

**Author:** [@Kaan\_Altay](https://forums.unrealengine.com/u/Kaan_Altay)\
**Replies:** 2\
**Last updated:** [January 5, 2023, 7:33pm UTC](https://forums.unrealengine.com/t/how-can-i-convert-a-array-to-a-structure/741274 "2023-01-05T19:33:58Z")

</div>

Hello everybody there is a node in unreal engine blueprint : how can i convert a array into struct in c++ for adding in a TMap? I specifically want to do this in c++

---

## [SplineComponent in TArray](https://forums.unrealengine.com/t/splinecomponent-in-tarray/349540)

<div class="topic-metadata">

**Author:** [@MenosGrandes](https://forums.unrealengine.com/u/MenosGrandes)\
**Replies:** 6\
**Last updated:** [November 6, 2022, 12:20am UTC](https://forums.unrealengine.com/t/splinecomponent-in-tarray/349540 "2022-11-06T00:20:49Z")

</div>

I Have no idea why I can’t edit the SplineComponent in Editor. I have simple ActorComponent : ULBranchActorComponent .h UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) class MGR\_API ULBranchActorComp…

---

## [Problem TArray with Uproperty(Interp) cannot link with the sequencer](https://forums.unrealengine.com/t/problem-tarray-with-uproperty-interp-cannot-link-with-the-sequencer/469137)

<div class="topic-metadata">

**Author:** [@dpotuznik](https://forums.unrealengine.com/u/dpotuznik)\
**Replies:** 1\
**Last updated:** [September 2, 2022, 1:06pm UTC](https://forums.unrealengine.com/t/problem-tarray-with-uproperty-interp-cannot-link-with-the-sequencer/469137 "2022-09-02T13:06:26Z")

</div>

Hi, i try to create a keyframe for my TArray struct but is not binded correctly when i click on the create keyframe is added on the sequencer and is changing the value correctely but is RED like is losing is connection…

---

## [Can't Add Objects to a TArray](https://forums.unrealengine.com/t/cant-add-objects-to-a-tarray/489479)

<div class="topic-metadata">

**Author:** [@Jarred003](https://forums.unrealengine.com/u/Jarred003)\
**Replies:** 1\
**Last updated:** [April 16, 2022, 11:32am UTC](https://forums.unrealengine.com/t/cant-add-objects-to-a-tarray/489479 "2022-04-16T11:32:55Z")

</div>

Hello, i’m a Unreal Engine beginner, i’m not able to add objects to my TArray. UPROPERTY(BlueprintReadWrite, Category = "Code") TArray\<UTrash\*\> Trashes; When a call TArray::Add nothing happends and TArray::Num is st…

---

## [ARRAY\_COUNT fails on array passed to method](https://forums.unrealengine.com/t/array-count-fails-on-array-passed-to-method/368795)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_d4efcd70](https://forums.unrealengine.com/u/anonymous_user_d4efcd70)\
**Replies:** 0\
**Last updated:** [August 30, 2016, 9:36pm UTC](https://forums.unrealengine.com/t/array-count-fails-on-array-passed-to-method/368795 "2016-08-30T21:36:52Z")

</div>

I’m trying to figure out why ARRAY\_COUNT works when the array is created within a method, but not when it is passed to the method. This compiles: TArray\<FName\> ValArr; FName Temp\[\] = { TEXT("10"), TEXT("20")}; ValArr.A…

---

## [Dynamic 2D Array using TArray](https://forums.unrealengine.com/t/dynamic-2d-array-using-tarray/382330)

<div class="topic-metadata">

**Author:** [@dlkulp](https://forums.unrealengine.com/u/dlkulp)\
**Replies:** 4\
**Last updated:** [March 9, 2022, 6:46am UTC](https://forums.unrealengine.com/t/dynamic-2d-array-using-tarray/382330 "2022-03-09T06:46:20Z")

</div>

Maybe I’m just completely missing the point here and there’s a better way to do this. I’m trying to get a pretty simple dynamically sized 2D array of custom types. This is so close, but the response is not dynamic and …

---

## [AsyncTask slower in packaged game when using TArray](https://forums.unrealengine.com/t/asynctask-slower-in-packaged-game-when-using-tarray/479527)

<div class="topic-metadata">

**Author:** [@Kaiagan](https://forums.unrealengine.com/u/Kaiagan)\
**Replies:** 2\
**Last updated:** [October 14, 2021, 8:54pm UTC](https://forums.unrealengine.com/t/asynctask-slower-in-packaged-game-when-using-tarray/479527 "2021-10-14T20:54:10Z")

</div>

Hi, I’m using a lot of AsyncTasks (FNonAbandonableTask) to procedurally generate the map data when launching the level. In editor (whether it’s PIE or standalone) the generation is taking approximately 8 seconds. Once t…

---

## [Prevent TQueue elements from being garbage collected](https://forums.unrealengine.com/t/prevent-tqueue-elements-from-being-garbage-collected/481748)

<div class="topic-metadata">

**Author:** [@Dr4kedecep](https://forums.unrealengine.com/u/Dr4kedecep)\
**Replies:** 4\
**Last updated:** [September 21, 2021, 4:45pm UTC](https://forums.unrealengine.com/t/prevent-tqueue-elements-from-being-garbage-collected/481748 "2021-09-21T16:45:35Z")

</div>

I know this problem has already been discussed on other threads, but I still find this aspect a bit confusing. As I have understood, there is no easy way (like using UPROPERTY() for TArrays, TMap etc.) to prevent the GC…

---

## [Find() for an FString array always returns -1?](https://forums.unrealengine.com/t/find-for-an-fstring-array-always-returns-1/487575)

<div class="topic-metadata">

**Author:** [@Samathan](https://forums.unrealengine.com/u/Samathan)\
**Replies:** 4\
**Last updated:** [August 17, 2021, 10:49pm UTC](https://forums.unrealengine.com/t/find-for-an-fstring-array-always-returns-1/487575 "2021-08-17T22:49:45Z")

</div>

Here’s the code I’m using, and it’s a bit of a mess but the code isn’t the problem… for (int32 ClassIndex = 0; ClassIndex \< TileClassArray.Num(); ClassIndex++) { AlphabetIndex = AlphabetArray-\>Find(TileClassArray\[Class…

---

## [TArray Find No operator found or suitable conversion](https://forums.unrealengine.com/t/tarray-find-no-operator-found-or-suitable-conversion/290577)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_958fa14f](https://forums.unrealengine.com/u/anonymous_user_958fa14f)\
**Replies:** 9\
**Last updated:** [May 19, 2021, 5:48pm UTC](https://forums.unrealengine.com/t/tarray-find-no-operator-found-or-suitable-conversion/290577 "2021-05-19T17:48:55Z")

</div>

I created a custom struct called FItem. Then I declared an Array in my header: TArray\>FItem MyItems; (cant write the arrows here but they are done correctly in my code) Then in my cpp FItem Temp; MyItems.Find(Tem…

---

## [TArray with custom class EXCEPTION\_ACCESS\_VIOLATION](https://forums.unrealengine.com/t/tarray-with-custom-class-exception-access-violation/482022)

<div class="topic-metadata">

**Author:** [@Mestereod](https://forums.unrealengine.com/u/Mestereod)\
**Replies:** 1\
**Last updated:** [April 22, 2021, 9:16pm UTC](https://forums.unrealengine.com/t/tarray-with-custom-class-exception-access-violation/482022 "2021-04-22T21:16:10Z")

</div>

Unreal show me line “TilePtr& tile = m\_tiles\[getTileIndex(pos)\];” in TileBlock::getOrCreate() TileBlock.h #pragma once #include "Tile.h" class RPGONLINE\_API TileBlock { public: TileBlock(); const TilePtr& cre…

---

## [Possible to make TArray point to existing allocated memory without copying?](https://forums.unrealengine.com/t/possible-to-make-tarray-point-to-existing-allocated-memory-without-copying/481522)

<div class="topic-metadata">

**Author:** [@k\_a\_s\_s\_k\_a\_s\_s](https://forums.unrealengine.com/u/k_a_s_s_k_a_s_s)\
**Replies:** 3\
**Last updated:** [April 8, 2021, 12:02pm UTC](https://forums.unrealengine.com/t/possible-to-make-tarray-point-to-existing-allocated-memory-without-copying/481522 "2021-04-08T12:02:44Z")

</div>

Dear Unreal Engine community! Is it possible to make a TArray point to existing memory instead of allocating new memory? For example, if there already exists some C-style array (i.e. uint8\* SomeArray), and I know the n…

---

## [Migrating to 4.9: UnrealHeader Tool fails at a UPROPERTY(BlueprintReadWrite) of TArray](https://forums.unrealengine.com/t/migrating-to-4-9-unrealheader-tool-fails-at-a-uproperty-blueprintreadwrite-of-tarray/334016)

<div class="topic-metadata">

**Author:** [@Heroico](https://forums.unrealengine.com/u/Heroico)\
**Replies:** 9\
**Last updated:** [March 9, 2021, 1:57pm UTC](https://forums.unrealengine.com/t/migrating-to-4-9-unrealheader-tool-fails-at-a-uproperty-blueprintreadwrite-of-tarray/334016 "2021-03-09T13:57:20Z")

</div>

Hi there! So, I had to spend a few long months away from my project (based on 4.8 at the moment). First thing I try to do when I came back is switching to Unreal Engine 4.9, and it blew up on me. UnrealHeaderTool chok…

---

## [Struct with member tarray of itself](https://forums.unrealengine.com/t/struct-with-member-tarray-of-itself/478742)

<div class="topic-metadata">

**Author:** [@PrettyTrue](https://forums.unrealengine.com/u/PrettyTrue)\
**Replies:** 1\
**Last updated:** [February 13, 2021, 10:08pm UTC](https://forums.unrealengine.com/t/struct-with-member-tarray-of-itself/478742 "2021-02-13T22:08:29Z")

</div>

In standard C++, we can use vectors and maps as a means of a tree structure struct Foo { Foo(); std::vector\<Foo\> subfoos; }; But TArray/TMap cannot do this (by design). Is there a standard approach for handling…

---

## [Save TArray to text file](https://forums.unrealengine.com/t/save-tarray-to-text-file/475642)

<div class="topic-metadata">

**Author:** [@AgentArachnid66](https://forums.unrealengine.com/u/AgentArachnid66)\
**Replies:** 1\
**Last updated:** [December 9, 2020, 6:21pm UTC](https://forums.unrealengine.com/t/save-tarray-to-text-file/475642 "2020-12-09T18:21:55Z")

</div>

I’m trying to write a class that will need to write an array of strings to a text file and also read from that same file. I’ve done some debugging and have no idea what’s wrong with it. I tested it with a SaveStringToFil…

[Next page](https://forums.unrealengine.com/tag/tarray/1617.md?match_all_tags=true&page=1&tags%5B%5D=tarray)
