# Draw Material to Render Target doesn't work in begin play (standalone)

**URL:** <https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583>\
**Category:** Rendering\
**Tags:** Render, draw, unreal-engine, bug-report, question\
**Created:** [September 25, 2016, 5:05pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583 "2016-09-25T17:05:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![TK-Master](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TK-Master](https://forums.unrealengine.com/u/TK-Master)\
**Post date:** [September 25, 2016, 5:05pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/1 "2016-09-25T17:05:48Z")

</div>

Hello there,

I discovered that the draw material to render target function (new in 4.13) doesn’t properly execute when used in begin play.

Note that it works in editor but **not** in standalone or packaged game.

The workaround is to add a small delay in begin play but I still think this should be fixed… there seems to be more inconsistencies in begin play, for example **[UE-36132](https://issues.unrealengine.com/issue/UE-36132)**.

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [September 25, 2016, 9:12pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/2 "2016-09-25T21:12:25Z")

</div>

I don’t think it’s a bug, but on event begin play, some assets are still loading, therefor, sometimes there is not object or material to project on to. In your event begin play try adding a delay before the draw material to render target.

Btw if you set a delay of 0ms, it will delay it one frame.

---

<div class="post-metadata">

**Author:** ![TK-Master](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TK-Master](https://forums.unrealengine.com/u/TK-Master)\
**Post date:** [September 26, 2016, 2:25am UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/3 "2016-09-26T02:25:12Z")

</div>

I shouldn’t have to add a delay though, the engine should take care of asset loading and whatnot before executing begin play.  
Plus it’s inconsistent between editor and standalone so I would say that’s a bug.

---

<div class="post-metadata">

**Author:** ![Night\_Watcher](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/night_watcher/32/1145400_2.png) [@Night\_Watcher](https://forums.unrealengine.com/u/Night_Watcher)\
**Post date:** [September 26, 2016, 2:32am UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/4 "2016-09-26T02:32:28Z")

</div>

True, but does a delay actually fixes it in the first place? Just try it to know if that is the source of the problem

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6e7b421a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6e7b421a](https://forums.unrealengine.com/u/anonymous_user_6e7b421a)\
**Post date:** [September 26, 2016, 3:49pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/5 "2016-09-26T15:49:50Z")

</div>

Hello Tk-Master,

Can you provide me with some screenshots of your setup as well as some steps so I can reproduce the issue on my end?

I ran some simple tests and did not get the same results. Below are the screenshots of my blueprint and the set up I used.

**Construction Script**

![108547-rtbp_constructionscript.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/7/747b1e0d53d6827e1142460a742c9be53969fe98.png)

**Event Graph**

 ![108548-rtbp_eventgraph.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/a/4aa4896651d78704a174561a9d1829409c5064c1.png)

**Event BeginPlay - Standalone**

 ![108549-rtbp_viewport.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/1/421744cfa2f5cb9f75af3d28471945366bba8c32.png)

This seems to be working as expected on my end, but let me know if you have additional questions and I will do my best to assist you.

Cheers,

---

<div class="post-metadata">

**Author:** ![TK-Master](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TK-Master](https://forums.unrealengine.com/u/TK-Master)\
**Post date:** [September 27, 2016, 12:13am UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/6 "2016-09-27T00:13:13Z")

</div>

That’s odd… that’s how I have it setup too.  
You tried it in standalone right? just making sure.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6e7b421a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6e7b421a](https://forums.unrealengine.com/u/anonymous_user_6e7b421a)\
**Post date:** [September 28, 2016, 2:15pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/7 "2016-09-28T14:15:21Z")

</div>

Yes, I tested in PIE, New Window, and Standalone mode. All worked as expected.

Let me know if you are still unable to get this working and I can provide you with a test project to reverse engineer and figure out the differences.

Thanks,

---

<div class="post-metadata">

**Author:** ![TK-Master](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TK-Master](https://forums.unrealengine.com/u/TK-Master)\
**Post date:** [September 28, 2016, 3:28pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/8 "2016-09-28T15:28:46Z")

</div>

Alright, so I have uploaded a test project which also includes a packaged version (under WindowsNoEditor folder) just to make sure we are using the exact same thing.

> **[Meet Google Drive – One place for all your files](https://accounts.google.com/ServiceLogin?service=wise&passive=1209600&continue=https:%2F%2Fdrive.google.com%2Ffile%2Fd%2F0B7Z9rT16MoBodTRRSFhMVDJQUkE%2Fedit&followup=https:%2F%2Fdrive.google.com%2Ffile%2Fd%2F0B7Z9rT16MoBodTRRSFhMVDJQUkE%2Fedit)**
>
> Google Drive is a free way to keep your files backed up and easy to reach from any phone, tablet, or computer. Start with 15GB of Google storage – free.

Also I’m using 4.13.0 from the launcher.

If you launch the packaged game (or run the project in standalone) you should see a black mesh (meaning the render target is black/empty).  
But if you start the project in viewport play/editor mode you should see an icon painted on the mesh instead.

I have also noticed that if I use a translucent (or alphaComposite etc.) material to draw to the render target then the game doesn’t even start properly (freezes/black screen on startup)… definitely something weird going on here!

If it works for you the same in both modes then this could be a hardware bug/incompatibility(?)… in which case I will try testing this on another machine.

Thanks for your help so far Andrew!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6e7b421a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6e7b421a](https://forums.unrealengine.com/u/anonymous_user_6e7b421a)\
**Post date:** [September 28, 2016, 7:05pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/9 "2016-09-28T19:05:52Z")

</div>

Hello TK-Master,

Thanks for providing the test project as I was able to see what the differences between my own project and yours. I can confirm what you are reporting and have gone ahead and entered a bug report for the issue. You can track the issue following the link below on our new Public Issues Tracker.

**[UE-36558](https://issues.unrealengine.com/issue/UE-36558)**

Once the issue has been addressed by our engineers, the fix will be added to the release notes for fixed issues within an upcoming full engine or hotfix release.

Let me know if you have further questions or need additional assistance.

Cheers,

---

<div class="post-metadata">

**Author:** ![Dsine](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dsine](https://forums.unrealengine.com/u/Dsine)\
**Post date:** [April 13, 2017, 4:35pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/10 "2017-04-13T16:35:16Z")

</div>

I have the same problem in 4.15.1, just a heads up  
(edit: if the CanvasRenderTarget2d texture is dynamically created in the blueprint, I don’t have this problem)

---

<div class="post-metadata">

**Author:** ![Ben0nator](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ben0nator](https://forums.unrealengine.com/u/Ben0nator)\
**Post date:** [May 19, 2020, 10:39pm UTC](https://forums.unrealengine.com/t/draw-material-to-render-target-doesnt-work-in-begin-play-standalone/371583/11 "2020-05-19T22:39:32Z")

</div>

The issue tracker ([UE-36558](https://issues.unrealengine.com/issue/UE-36558)) marks the issue as solved in 4.23, but I can confirm the issue is still present in 4.25. If not reproducible, I can upload a sample. The workaround as noted is to add a delay after _BeginPlay_.
