# Texture2d in UFunction

**URL:** <https://forums.unrealengine.com/t/texture2d-in-ufunction/476046>\
**Category:** Asset Creation\
**Tags:** ufunction, unreal-engine, Scripting, question\
**Created:** [December 17, 2020, 12:30pm UTC](https://forums.unrealengine.com/t/texture2d-in-ufunction/476046 "2020-12-17T12:30:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethidium](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ethidium](https://forums.unrealengine.com/u/Ethidium)\
**Post date:** [December 17, 2020, 12:30pm UTC](https://forums.unrealengine.com/t/texture2d-in-ufunction/476046/1 "2020-12-17T12:30:36Z")

</div>

Hi, I’d like to create a blueprint function that takes a texture2d and some coordinates as an input. I can add input pins for basic data types:

```
UFUNCTION(BlueprintCallable, Category = "MyCategory")
	int ReadMap(int x, int y,);

```

but how do I add a texture2d as an input?

thanks

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [December 17, 2020, 4:59pm UTC](https://forums.unrealengine.com/t/texture2d-in-ufunction/476046/2 "2020-12-17T16:59:04Z")

</div>

Just use pointer - UTexture2D\* is Ok.

```
UFUNCTION(BlueprintCallable, Category = "Test")
	void Fun(UTexture2D* texture, int32 X, int32 Y) {}
```

---

<div class="post-metadata">

**Author:** ![Ethidium](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ethidium](https://forums.unrealengine.com/u/Ethidium)\
**Post date:** [December 17, 2020, 5:08pm UTC](https://forums.unrealengine.com/t/texture2d-in-ufunction/476046/3 "2020-12-17T17:08:31Z")

</div>

Ah fantastic, thanks for the quick reply. That works perfectly - guess I need to go and educate myself about pointers now!
