Ensure condition failed on project start

Hello !
I’ve had this issue for a while now where every time I open my project and I dive in a blueprint or a map, anything I get this error :

Script Stack (0 frames):

Ensure condition failed: !FindPin(FFunctionEntryHelper::GetWorldContextPinName()) [File:D:/Build/++UE4/Sync/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionEntry.cpp] [Line: 364] 

[2020.08.11-17.28.41:822][238]LogOutputDevice: Error: Ensure condition failed: !FindPin(FFunctionEntryHelper::GetWorldContextPinName()) [File:D:/Build/++UE4/Sync/Engine/Source/Editor/BlueprintGraph/Private/K2Node_FunctionEntry.cpp] [Line: 364] 


[2020.08.11-17.28.41:822][238]LogStats:             FDebug::EnsureFailed -  0.000 s
UE4Editor.exe has triggered a breakpoint.

It doesn’t matter which blueprint I open I always have this error poping. From what I’ve find which is very little it can happen when the actor doesn’t have a proper “world” but in my case it’s happening with anything so I don’t see how this could be related specially since I don’t even need to run a map.
This is not breaking anything by the way. I just get this error, press continue in VS and after that this error never come again until I relaunch the all project.

If you have any idea I would be very happy haha
Thanks !

Up ? Maybe? Someone?
Any idea? I tried to check if maybe I wasn’t calling world somewhere but haven’t found anything…
Thanks…

Hello, I know this is an old question but for those who found this when searching on google.

I Found an answer here

As described in above link,
It fixed by removing the usage of “World Context” input parameter or something like that.

In order to find a similar errors in your project “idkwhateverdude” suggested to use the blueprint search (https://docs.unrealengine.com/en-US/...rch/index.html)
and search for “World Context” on your blueprints​

11 Likes

The previous answer was right, remove world context pins, but didn’t say how.
I figured that out today. If you need this, read on.

Solution:

According to searches around the net, these pins are always there but hidden.
Yet, these pins are unnecessary for functions in a “Blueprint Function library.”

When I copy a function and rename it ( to use as a base for another function,) the Pin becomes visible. This is likely because the copy function in UE4 doesn’t know the pin is supposed to be hidden and mark it accordingly.

If you delete this pin from the inputs list of the new function and then recompile any reference calls you should be okay. assuming your calls were all from within the same Blueprint Function Library.
If you have external calls to these functions, then the input pin on the node in the referencing function will not go away after you delete the input pin within the function itself. This is normal and okay to ignore.

Here is where things go wrong. Sometimes the editor will not show the input pin on the inside of the function for you to delete. Yet, it thinks it is required due to that external call. So how to solve this? if you are just starting out, just perform the below for any functions called from outside your blueprint function library. otherwise, perform on all functions in the library to be sure

  1. Duplicate your function in the
    library. - you will now see the
    input pin
  2. Delete the input pin in
    the copied function
  3. Update all
    references to the new function which
    has the pin removed
  4. Delete the
    original function
  5. Rename your
    function to your liking

Note: if you have lots of interconnected functions it will be easier for you to create a new blueprint function library and copy all functions to that new library, then delete all the input pins for world context. then update references from the old library to your new library. Lastly delete the old library.

10 Likes

I am absolutley having this issue but can’t get it resolved. I read that adding a lone Get Player Controller node in the Function in the Library helps as well but alas no. Any of the duplication steps listed doesn’t bring back the input world context node - even starting from scratch.

I too am having this issue, and duplicating the function in the library does not expose the World Context input pin. Starting with a new Blueprint Function Library and copying the functions (without duplicating them) and then updating the references also does not make the pin go away. Plugging in a World Context reference to all of the exposed pins also does not resolve the issue. I have absolutely no idea how to fix this, and am just leaning toward “don’t use function libraries”. That would require a lot of additional work though so I am still hoping for a workaround.

EDIT: Issue resolved. I plugged in a World Context variable to every single exposed World Context pin in all library functions, in all blueprint libraries, and also in the function calls. Bottom line: Never leave the World Context pin empty when doing anything related to blueprint function libraries. Always plug in the world context variable. Doing this actually didn’t even make the error go away, I still get the ``GetWorldContextPinName()" error. But the cook doesn’t fail anymore and I can package the game.

2 Likes

What do you plug into the world context pin? I used to try to plug stuff in there but it never compiled so I assumed it has to be empty.

For those with C++ understanding, running the project through Visual Studio will trigger the ensure() function and cause a breakpoint. By going back through the call stack and viewing the input variables of the blueprint classes, you can read the name of both the calling class as well as the Blueprint Function Library containing the __WorldContext parameter that shouldn’t be there (there’s also a “then” parameter which you can ignore).

(@Willard720)
Simply launch the engine, go to the found Blueprint Function Library, and remove the __WorldContext parameter from the function. Nofear001 was correct in saying that this is caused by copying an existing function inside a function library. Removing the __WorldContext input pin from the function will remove the error and cause the succesful opening of the project, without the ensure() function notifying Visual Studio, as well as a succesful compile.

Tl;dr: __WorldContext pin needs REMOVED, not filled. Calling the function has 0 WorldContext pins, Unreal does this for you under the hood.

7 Likes

What has worked for me: Find in Blueprints “World Context”, only look for function inputs, remove from the function and save:

image

Another thread:

9 Likes

I think this is the worst bug/issue of all time! Totally no sense and I see there is no way to make it %100 correct. It is nearly impossible to find every single “worldcontext” in a game project. We are making the game over 1 year,and had tons of functions and libraries and the interesting one is we had packed before! but i think there is one single node has that hidden pin. and it is impossible to find it and it is impossible to pack the game! This is insane! THIS IS INSANE!

1 Like

Hi there,
Have you tried my previous reply? This issue seems to be related only to function inputs, which are represented by the squared icon below. That’d helped me to narrow down the search:
image

Life saver. This was such an elegant solution. Thanks a bunch!

hey , yeah i tried that and i found the issue in a blueprint actor .My issue , I was trying to find it in the function libraries.
To be honest this is one of the weird issuesi have ever seen. I can not understand why unreal dont log the problematic asset and function or event name.
But yeah it worked thank you so much :slight_smile:

1 Like

Just came to thank you a ton!! Life saver!!!

1 Like

this is brilliant, thank you)

1 Like

Just got this problem which was initially caused by duplicating a blueprint function library function. When copied it basically created a _worldcontext input variable that completely broke project exporting.

Luckily I caught the problem early otherwise I would have lost hours of work probably having to revert back.

I had the same issue, and the issue was was in the “blueprint functions”.
There are about 100+ functions in my library, so I was afraid that I have to rebuild them.
I have started to copy and paste the functions to new library but suddenly one of the functions popped to the bottom for no reason, I opened it and it had the “world context” pin which was never added by me.
After removal of the pin all worked.
This is a life saver…

1 Like