Check if Blueprint is being run within the editor (i.e if WITH_EDITOR in C++)

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").

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!

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

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)

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?

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

Same issue here. Were these removed?

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

1 Like

Maybe the poster was using a 3rd-Party Plugin for this and just forgot about it?
Anyway…
You can always this try below… Disclaimer: Didn’t do a whole lot of testing on it.

1 Like

As of 4.25, this is the correct answer:

Capture.JPG

7 Likes

Thanks, this is exactly what I was looking for!

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

	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 .

2 Likes

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

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

check the free plugin LE Extended Standard Library in Code Plugins - UE Marketplace
That has those nodes without the need to do anything more than install it and it’s free

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.

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

It’s not my plugin, but I can’t live without it. you can use it in blueprints only projects, otherwise I would not have put it as a solution :joy:. The plugin exposes a lot of usable c++ functions.
image

well if you do blueprints, you’re a developper

1 Like

I know this is a blueprint question but with a few C++ lines you can get very precise results, see here How to check if game is running - #12 by tuatec. Maybe someone will find this useful as well, it took me quite some time to figure this out. :wink:

Another thing that seems to work is

static bool isEditorBuild()
{
#ifdef UE_EDITOR_BUILD
return true;
#else
return false;
#endif
}

1 Like

To add to this, the complete code for this would be (for UE5 and onward):

Assuming you’ve made a header file named “CommonUtilsBlueprintLibrary”, this would work out of the box and provide you with a globally callable BP function named “RunningInPIE”.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "CommonUtilsBlueprintLibrary.generated.h"

/**
 *
 */
UCLASS()
class UCommonUtilsBlueprintLibrary: public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

	//! Allow the blueprint to determine whether we are running with the editor or not
	UFUNCTION(BlueprintPure, BlueprintCallable, Category = "CommonUtilsFunctionLibrary")
	static bool RunningInPIE()
        #if WITH_EDITOR
            return true;
        #else
            return false;
        #endif
};
	
};
2 Likes