# \#pointers

**URL:** https://forums.unrealengine.com/tag/pointers/3370.md

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

---

## [How to get an interface pointer variable to work w/UPROPERTY()](https://forums.unrealengine.com/t/how-to-get-an-interface-pointer-variable-to-work-w-uproperty/383017)

<div class="topic-metadata">

**Author:** [@YawLighthouse](https://forums.unrealengine.com/u/YawLighthouse)\
**Replies:** 17\
**Last updated:** [November 4, 2025, 3:54am UTC](https://forums.unrealengine.com/t/how-to-get-an-interface-pointer-variable-to-work-w-uproperty/383017 "2025-11-04T03:54:32Z")

</div>

Hello, I am attempting to have an interface pointer variable that is declared in the header be VisibleAnywhere, BlueprintReadOnly in the UPROPERTY() but when I compile it gives me an error: UPROPERTY pointers cannot be …

---

## [Using libraries with std::shared\_ptrs](https://forums.unrealengine.com/t/using-libraries-with-std-shared-ptrs/1173215)

<div class="topic-metadata">

**Author:** [@DentonJC](https://forums.unrealengine.com/u/DentonJC)\
**Replies:** 3\
**Last updated:** [April 10, 2024, 9:16am UTC](https://forums.unrealengine.com/t/using-libraries-with-std-shared-ptrs/1173215 "2024-04-10T09:16:24Z")

</div>

I have a third party library that I need to include in my Unreal project. This library is full of std::shared\_ptr and expects std::shared\_ptrs as part of its API. Its not really feasable to swap them all to TSharedPtr. …

---

## [Field becomes nullptr when comes out of function space](https://forums.unrealengine.com/t/field-becomes-nullptr-when-comes-out-of-function-space/479260)

<div class="topic-metadata">

**Author:** [@Cybeaster](https://forums.unrealengine.com/u/Cybeaster)\
**Replies:** 1\
**Last updated:** [February 23, 2021, 1:53pm UTC](https://forums.unrealengine.com/t/field-becomes-nullptr-when-comes-out-of-function-space/479260 "2021-02-23T13:53:01Z")

</div>

I have a field in class that stores a references to objects and I have a function with 2 methods in it. I pass 2 null pointers to the first function to assign values to them, and after I pass these pointers to second fu…

---

## [How to initialise UStaticMeshComponent\* through pointers?](https://forums.unrealengine.com/t/how-to-initialise-ustaticmeshcomponent-through-pointers/453124)

<div class="topic-metadata">

**Author:** [@Joshua\_Ellis](https://forums.unrealengine.com/u/Joshua_Ellis)\
**Replies:** 1\
**Last updated:** [July 31, 2019, 8:43am UTC](https://forums.unrealengine.com/t/how-to-initialise-ustaticmeshcomponent-through-pointers/453124 "2019-07-31T08:43:15Z")

</div>

Hi. I’m having an issue with implementing an architecture I want in regards to UStaticMeshes. My use case is to have arrays of data for voxels and have an array of UStaticMeshComponent pointers so I don’t have to have vo…

---

## [Adding some magazines to try in FPS game](https://forums.unrealengine.com/t/adding-some-magazines-to-try-in-fps-game/440017)

<div class="topic-metadata">

**Author:** [@Ziad7](https://forums.unrealengine.com/u/Ziad7)\
**Replies:** 0\
**Last updated:** [December 23, 2018, 4:39pm UTC](https://forums.unrealengine.com/t/adding-some-magazines-to-try-in-fps-game/440017 "2018-12-23T16:39:48Z")

</div>

Hello Everyone ! I’m working on a FPS game and I have the following classes: Weapon, Magazine and the Character Classes. In Weapon class I’ve a pointer to the current used Magazine. In the Character class I’ve …

---

## [Getting UTexture\*, but not in constructor](https://forums.unrealengine.com/t/getting-utexture-but-not-in-constructor/428755)

<div class="topic-metadata">

**Author:** [@WarpSpider833](https://forums.unrealengine.com/u/WarpSpider833)\
**Replies:** 2\
**Last updated:** [July 5, 2018, 4:38pm UTC](https://forums.unrealengine.com/t/getting-utexture-but-not-in-constructor/428755 "2018-07-05T16:38:13Z")

</div>

I need to find a UTexture pointer, but I’ve just realize that I can’t do it in the constructor. Until now I’ve been using: FString Path = TEXT("/Path/.."); static ConstructorHelpers::FObjectFinder\<UTexture\> TexReferenc…

---

## [Why does deleting the double pointer in this code cause garbage collection crashes?](https://forums.unrealengine.com/t/why-does-deleting-the-double-pointer-in-this-code-cause-garbage-collection-crashes/335955)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_802c67ad](https://forums.unrealengine.com/u/anonymous_user_802c67ad)\
**Replies:** 1\
**Last updated:** [August 6, 2017, 6:10pm UTC](https://forums.unrealengine.com/t/why-does-deleting-the-double-pointer-in-this-code-cause-garbage-collection-crashes/335955 "2017-08-06T18:10:16Z")

</div>

Here’s how my code works: Every frame, I record a pointer to an actor, to a pointer in a vector. When I choose, all the pointers in this vector, and their corresponding frame, now indirectly point to the same actor, be…

---

## [How to safely store a pointer to my UINTERFACE?](https://forums.unrealengine.com/t/how-to-safely-store-a-pointer-to-my-uinterface/282930)

<div class="topic-metadata">

**Author:** [@undercover](https://forums.unrealengine.com/u/undercover)\
**Replies:** 7\
**Last updated:** [August 2, 2017, 9:47pm UTC](https://forums.unrealengine.com/t/how-to-safely-store-a-pointer-to-my-uinterface/282930 "2017-08-02T21:47:45Z")

</div>

Hi! I have created an UINTERFACE called “MyInterface” i.e. UMyInterface and IMyInterface. A class that implements this interface and inheriting AActor. Then in the world I raycast where the mouse pointer is and get an …

---

## [Get UProperty of UStruct returns wrong value.](https://forums.unrealengine.com/t/get-uproperty-of-ustruct-returns-wrong-value/387007)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_d860badc](https://forums.unrealengine.com/u/anonymous_user_d860badc)\
**Replies:** 2\
**Last updated:** [March 31, 2017, 8:08am UTC](https://forums.unrealengine.com/t/get-uproperty-of-ustruct-returns-wrong-value/387007 "2017-03-31T08:08:13Z")

</div>

I am trying to access value from UStruct defined in UStruct USTRUCT() struct FJsonData { GENERATED\_USTRUCT\_BODY() UPROPERTY() double prop= 0; }; I am using FJsonObjectConverter to convert string to this UStruct: F…

---

## [How to pass by a variable by reference in a function and set it in blueprints?](https://forums.unrealengine.com/t/how-to-pass-by-a-variable-by-reference-in-a-function-and-set-it-in-blueprints/365599)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_1ed1c3df](https://forums.unrealengine.com/u/anonymous_user_1ed1c3df)\
**Replies:** 6\
**Last updated:** [July 31, 2016, 10:02pm UTC](https://forums.unrealengine.com/t/how-to-pass-by-a-variable-by-reference-in-a-function-and-set-it-in-blueprints/365599 "2016-07-31T22:02:47Z")

</div>

I’m not too new to the concepts in C++, I understand pointers, how they work, and I want to try to use something similar in blueprints if the system would let me. I have a series of buttons that toggle their own bool wh…

---

## [Access Violation When Trying To Create TSharedPtr of (this)Object](https://forums.unrealengine.com/t/access-violation-when-trying-to-create-tsharedptr-of-this-object/356005)

<div class="topic-metadata">

**Author:** [@Diddykonga](https://forums.unrealengine.com/u/Diddykonga)\
**Replies:** 4\
**Last updated:** [May 3, 2016, 11:25pm UTC](https://forums.unrealengine.com/t/access-violation-when-trying-to-create-tsharedptr-of-this-object/356005 "2016-05-03T23:25:56Z")

</div>

// Parse the folders array const TArray\<TSharedPtr\>\* FolderDescriptors; if (Tree-\>TryGetArrayField(TEXT(“folder”), /out/ FolderDescriptors)) { for (TSharedPtr FolderDescriptor : \*FolderDescriptors) { TSharedPtr Fol…

---

## [Spawning Blueprint class from random pool defined in editor](https://forums.unrealengine.com/t/spawning-blueprint-class-from-random-pool-defined-in-editor/355516)

<div class="topic-metadata">

**Author:** [@NikDouglas](https://forums.unrealengine.com/u/NikDouglas)\
**Replies:** 1\
**Last updated:** [April 26, 2016, 10:27am UTC](https://forums.unrealengine.com/t/spawning-blueprint-class-from-random-pool-defined-in-editor/355516 "2016-04-26T10:27:31Z")

</div>

Hi all, I’m trying to create a class that can randomly spawn a Blueprint class from a pool defined through a TArray in the editor. For this I have two classes: A Section class and a SectionScene class. In the Section cl…

---

## [FHitResult\* OutSweepHitResult = nullptr](https://forums.unrealengine.com/t/fhitresult-outsweephitresult-nullptr/340056)

<div class="topic-metadata">

**Author:** [@shiftone](https://forums.unrealengine.com/u/shiftone)\
**Replies:** 2\
**Last updated:** [November 30, 2015, 8:25pm UTC](https://forums.unrealengine.com/t/fhitresult-outsweephitresult-nullptr/340056 "2015-11-30T20:25:47Z")

</div>

UFUNCTION(BlueprintCallable, Category = “Utilities|Transformation”, meta = (DisplayName = “AddLocalRotationQuat”, AdvancedDisplay = “bSweep,SweepHitResult,bTeleport”)) void AddLocalRotationQuat(const FQuat& DeltaRotatio…

---

## [UE4 crashes upon opening Animation Blue Print - Access violation - code c0000005](https://forums.unrealengine.com/t/ue4-crashes-upon-opening-animation-blue-print-access-violation-code-c0000005/331542)

<div class="topic-metadata">

**Author:** [@WinterStasis](https://forums.unrealengine.com/u/WinterStasis)\
**Replies:** 1\
**Last updated:** [September 15, 2015, 6:54pm UTC](https://forums.unrealengine.com/t/ue4-crashes-upon-opening-animation-blue-print-access-violation-code-c0000005/331542 "2015-09-15T18:54:28Z")

</div>

Been working in Unreal for a bit now, and this is the only project I have had this issue. It is seemingly random, as in I cannot consistently replicate it, but it ONLY happens when I open an Animation Blue Print that I’m…

---

## [C++ - Why are pointers used so much?](https://forums.unrealengine.com/t/c-why-are-pointers-used-so-much/291898)

<div class="topic-metadata">

**Author:** [@Huskysontherun](https://forums.unrealengine.com/u/Huskysontherun)\
**Replies:** 6\
**Last updated:** [August 25, 2014, 7:18pm UTC](https://forums.unrealengine.com/t/c-why-are-pointers-used-so-much/291898 "2014-08-25T19:18:31Z")

</div>

Using references is inconvenient since they cannot be NULL, so you would have to use a wrapper class if the object being referenced is allowed to not exist. Passing objects by value results in excessive memory copying (m…

---

## [How to garbage collect USTRUCTs?](https://forums.unrealengine.com/t/how-to-garbage-collect-ustructs/288011)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_7a9aff171](https://forums.unrealengine.com/u/anonymous_user_7a9aff171)\
**Replies:** 1\
**Last updated:** [July 14, 2014, 7:08am UTC](https://forums.unrealengine.com/t/how-to-garbage-collect-ustructs/288011 "2014-07-14T07:08:57Z")

</div>

I am having a hard time understanding how to delete UStructs. Unlike UObjects, they are not handled by Unreal’s garbage collection system (is this correct?) and we are supposed to delete all dynamically created UStructs …

---

## [TSubobjectPtr vs Native C++ Pointer](https://forums.unrealengine.com/t/tsubobjectptr-vs-native-c-pointer/286675)

<div class="topic-metadata">

**Author:** [@dbrizov](https://forums.unrealengine.com/u/dbrizov)\
**Replies:** 4\
**Last updated:** [June 25, 2014, 7:51am UTC](https://forums.unrealengine.com/t/tsubobjectptr-vs-native-c-pointer/286675 "2014-06-25T07:51:06Z")

</div>

Can anyone tell me what is the difference between the pointers in the UnrealEngine API and the native C++ pointers. Native pointers are easier to write and I prefer to use it, but are there any disadvantages compared to …
