# Check if Blueprint is being run within the editor (i.e if WITH\_EDITOR in C++)

**URL:** <https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [September 24, 2014, 12:15pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952 "2014-09-24T12:15:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![VSZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VSZ](https://forums.unrealengine.com/u/VSZ)\
**Post date:** [September 24, 2014, 12:15pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/1 "2014-09-24T12:15:14Z")

</div>

I’m looking for the Blueprint equivalent of **#if WITH\_EDITOR** which is used in UE C++ to run perform certain actions only if the game is running within the context of the editor.

The main intention is to add useful debugging information in exceptional scenarios. Eg: Cast To MyActor fails and I want to print a simple message to the screen so I know that. I realize I can use the output log for this but I find it too verbose for this purpose. So does any such node exist to determine if game context is within the editor?

Not sure if the fact that blueprints being converted to a different form while cooking the game prevents such a check from being feasible.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c4a8bfe81](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c4a8bfe81](https://forums.unrealengine.com/u/anonymous_user_c4a8bfe81)\
**Post date:** [December 13, 2014, 8:05pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/2 "2014-12-13T20:05:18Z")

</div>

Bump. I’m having the same problem, anyone have any solution?

---

<div class="post-metadata">

**Author:** ![marsonmao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@marsonmao](https://forums.unrealengine.com/u/marsonmao)\
**Post date:** [June 13, 2016, 3:35am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/3 "2016-06-13T03:35:56Z")

</div>

I can’t believe that there’s no answer for this question!  
The best way I know is GetPlatformName node, but I don’t think it’s a good way, since it only returns Windows for PIE.  
So is there really no BP equivalent for WITH\_EDITOR?!

---

<div class="post-metadata">

**Author:** ![Stephane\_Roncada](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stephane\_Roncada](https://forums.unrealengine.com/u/Stephane_Roncada)\
**Post date:** [August 8, 2016, 7:15pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/4 "2016-08-08T19:15:25Z")

</div>

Bump…Bump…

---

<div class="post-metadata">

**Author:** ![EniGmaa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EniGmaa](https://forums.unrealengine.com/u/EniGmaa)\
**Post date:** [August 9, 2016, 6:53am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/5 "2016-08-09T06:53:20Z")

</div>

Yes im sure ive seen a bp node already that does this i’m not at my computer right now but I’ll look later and post it if I find it

Or you could do it yourself simple make a c++ function like this

//! Allow the blueprint to determine whether we are running with the editor or not

UFUNCTION( BlueprintPure, Category = Whatever )  
bool IsWithEditor() const  
{  
#if WITH\_EDITOR  
return true;  
#else  
return false;  
#endif  
}

---

<div class="post-metadata">

**Author:** ![Midsoft\_Games](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Midsoft\_Games](https://forums.unrealengine.com/u/Midsoft_Games)\
**Post date:** [February 5, 2017, 11:52am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/6 "2017-02-05T11:52:30Z")

</div>

**Yes. I think I found a method. Try _Is Shipping Build_ node. Make a branch and if _Is Shipping Build_ is equal to true, then do whatever you want and if it is false, then do nothing. I tried it in 4.13 and it works.**

---

<div class="post-metadata">

**Author:** ![vlad.serbanescu11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vlad.serbanescu11](https://forums.unrealengine.com/u/vlad.serbanescu11)\
**Post date:** [February 5, 2017, 12:47pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/7 "2017-02-05T12:47:07Z")

</div>

Add a custom option, such as “-editor” inside the server game options line, found in Edit-\>EditorPreferences-\>Play(LevelEditor)-\>MultiplayerOptions-\>ServerGameOptions.

Then make a macro or a global function in BP to GetGameOptions-\>DoesOptionExist("-editor").

---

<div class="post-metadata">

**Author:** ![OptimisticMonkey](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/optimisticmonkey/32/906571_2.png) [@OptimisticMonkey](https://forums.unrealengine.com/u/OptimisticMonkey)\
**Post date:** [February 5, 2017, 2:11pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/8 "2017-02-05T14:11:24Z")

</div>

Rama’s free Victory Plugin has a node to identify whether game logic is running in Editor,PIE,or Game World!  
[(39) Rama's Extra Blueprint Nodes for You as a Plugin, No C++ Required! - Blueprint Visual Scripting - Unreal Engine Forums](https://forums.unrealengine.com/showthread.php?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required)!

Also the free Low Entry Standard Library plugin has a platform node (not exactly what you want, but it also has other useful stuff )

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_db2c7ad9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_db2c7ad9](https://forums.unrealengine.com/u/anonymous_user_db2c7ad9)\
**Post date:** [October 16, 2019, 12:33am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/9 "2019-10-16T00:33:57Z")

</div>

Since this is where google led me and it has NOT been updated, there is a ‘With Editor’ node now… You can just use that (its in the same place as the Is Shipping, Is Debug, Etc nodes)

---

<div class="post-metadata">

**Author:** ![wilberolive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wilberolive](https://forums.unrealengine.com/u/wilberolive)\
**Post date:** [January 23, 2020, 11:41am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/10 "2020-01-23T11:41:48Z")

</div>

Where are these With Editor and Is Shipping nodes that you speak of? I’ve tried adding using them in Blueprint in 4.24 but these nodes don’t exist. I’ve unticked Context Sensitive too, but they still don’t show up?

---

<div class="post-metadata">

**Author:** ![Yasochi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yasochi](https://forums.unrealengine.com/u/Yasochi)\
**Post date:** [January 30, 2020, 5:07pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/13 "2020-01-30T17:07:39Z")

</div>

A bit late but in case people are still looking for it (like me XD )

There is the node “_ **Print String** _”, which spawn the message you want in the editor during play.  
Not sure if it’s what you are looking for as I don’t know C++, but here you go  
 ![Print-string.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/1/41a21cf6c9f35b2aeb92ce6ee99527cb21b90e85.png)

---

<div class="post-metadata">

**Author:** ![eobet](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eobet/32/465239_2.png) [@eobet](https://forums.unrealengine.com/u/eobet)\
**Post date:** [April 19, 2020, 10:23am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/14 "2020-04-19T10:23:17Z")

</div>

> [@wilberolive](#):
>
> Where are these With Editor and Is Shipping nodes that you speak of? I’ve tried adding using them in Blueprint in 4.24 but these nodes don’t exist. I’ve unticked Context Sensitive too, but they still don’t show up?

Same issue here. Were these removed?

Or did the name change? This thread is literally the only result if I search for it.

---

<div class="post-metadata">

**Author:** ![roberteker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roberteker](https://forums.unrealengine.com/u/roberteker)\
**Post date:** [April 22, 2020, 8:34am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/17 "2020-04-22T08:34:16Z")

</div>

As of 4.25, this is the correct answer:

![Capture.JPG](https://d3kjluh73b9h9o.cloudfront.net/original/3X/4/b/4bbce234c694cb0366509eb078dc5d0d0c1f3b25.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b81f854c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b81f854c](https://forums.unrealengine.com/u/anonymous_user_b81f854c)\
**Post date:** [June 17, 2020, 3:32pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/18 "2020-06-17T15:32:04Z")

</div>

> [@](#):
>
> As of 4.25, this is the correct answer:

Thanks, this is exactly what I was looking for!

---

<div class="post-metadata">

**Author:** ![Levantail](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/levantail/32/88718_2.png) [@Levantail](https://forums.unrealengine.com/u/Levantail)\
**Post date:** [June 24, 2021, 7:12am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/19 "2021-06-24T07:12:11Z")

</div>

This is NOT correct answer, as this have next code inside:

```auto
	static bool IsPackagedForDistribution()
	{
#if UE_BUILD_SHIPPING
		return true;
#else
		return false;
#endif
	}

```

Correct answer is to create Blueprint Library using C++ and use solution from @EniGmaa .

---

<div class="post-metadata">

**Author:** ![lehuan5062](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lehuan5062](https://forums.unrealengine.com/u/lehuan5062)\
**Post date:** [February 2, 2022, 10:57am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/20 "2022-02-02T10:57:06Z")

</div>

The node “Is Packaged For Distribution” works for me as well!

---

<div class="post-metadata">

**Author:** ![roberteker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roberteker](https://forums.unrealengine.com/u/roberteker)\
**Post date:** [February 7, 2022, 9:10am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/22 "2022-02-07T09:10:03Z")

</div>

Some of us using Unreal Engine aren’t game developers and don’t use any C++

---

<div class="post-metadata">

**Author:** ![DomusLudus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/domusludus/32/1215140_2.png) [@DomusLudus](https://forums.unrealengine.com/u/DomusLudus)\
**Post date:** [February 7, 2022, 2:09pm UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/23 "2022-02-07T14:09:44Z")

</div>

check the free plugin [LE Extended Standard Library in Code Plugins - UE Marketplace](https://www.unrealengine.com/marketplace/en-US/product/low-entry-extended-standard-library)  
That has those nodes without the need to do anything more than install it and it’s free

---

<div class="post-metadata">

**Author:** ![roberteker](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roberteker](https://forums.unrealengine.com/u/roberteker)\
**Post date:** [February 8, 2022, 9:36am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/24 "2022-02-08T09:36:24Z")

</div>

If that is your plugin, you should make it 100% clear on the marketplace page if the plugin requires the project to support C++ or not. Right now, to me it seems as if it does, which disqualifies it for us.

The solution I posted works for those who do not wish to have C++ at all.

---

<div class="post-metadata">

**Author:** ![lehuan5062](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lehuan5062](https://forums.unrealengine.com/u/lehuan5062)\
**Post date:** [February 8, 2022, 9:58am UTC](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952/25 "2022-02-08T09:58:04Z")

</div>

No, I used that plugin before, no need for C++.

[Next page](https://forums.unrealengine.com/t/check-if-blueprint-is-being-run-within-the-editor-i-e-if-with-editor-in-c/11952.md?page=2)
