# Can I access actors in world from plugin?

**URL:** <https://forums.unrealengine.com/t/can-i-access-actors-in-world-from-plugin/309915>\
**Category:** Plugins\
**Tags:** unreal-engine, Plugins, question\
**Created:** [March 8, 2015, 6:11am UTC](https://forums.unrealengine.com/t/can-i-access-actors-in-world-from-plugin/309915 "2015-03-08T06:11:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_6a45190a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6a45190a](https://forums.unrealengine.com/u/anonymous_user_6a45190a)\
**Post date:** [March 8, 2015, 6:11am UTC](https://forums.unrealengine.com/t/can-i-access-actors-in-world-from-plugin/309915/1 "2015-03-08T06:11:30Z")

</div>

I’m trying to make plugin for my game.  
I’ve created toolbar button which shows property window (created by FPropertyEditorModule). That property window is connected to my custom object for level editing as follow.

```
UCLASS(config=Game)
class UTileBEditorObject : public UObject {
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, Category = "TestCategory")
	float testFloat;

	UPROPERTY(EditAnywhere, Transient, Category = "TestCategory")
	class ATileController* targetTileController;

    //for test
	UPROPERTY(EditAnywhere, Category = "TestCategory")
	class AActor* targetActor;

};

```

The window shows properties correctly as screenshot but I can’t choose any actors or tilecontrollers in my level with warning:

```
LogProperty:Warning: Illegal TEXT reference to a private object in external package (BP_TileController_C /Game/Maps/TestMap.TestMap:PersistentLevel.BP_TileController_4) from referencer (TileBlockEditorObject /Engine/Transient.TileBlockEditorObject_0). Import failed...

```

![32995-1111.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/b/22b68cb79d728b98f9dd79dfd9444cd3b325f41e.png)

I found something in PropertyBaseObject.cpp:388~396, target, actors in the level, should be RF\_Public or Outermost() is the same each other to avoid this warning and get correct reference of actors in my plugin.

How can I fix this problem?

---

<div class="post-metadata">

**Author:** ![Wabo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wabo](https://forums.unrealengine.com/u/Wabo)\
**Post date:** [March 31, 2015, 9:00am UTC](https://forums.unrealengine.com/t/can-i-access-actors-in-world-from-plugin/309915/2 "2015-03-31T09:00:02Z")

</div>

Hey Cordis,

I’m struggling with getting this to work. Have you possibly found an answer to your question already? 🙂 I can’t find anything on the web about this issue.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![rajkosto](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rajkosto](https://forums.unrealengine.com/u/rajkosto)\
**Post date:** [July 5, 2015, 6:58pm UTC](https://forums.unrealengine.com/t/can-i-access-actors-in-world-from-plugin/309915/3 "2015-07-05T18:58:37Z")

</div>

You cannot have references to level actors from outside of the level.  
If you are ok with them being invalid when the level isn’t loaded, turn your actor pointers into TLazyObjectPtr

```
TLazyObjectPtr<ATileController> targetTileController;
```
