Download

Is a BlueprintNativeEvent synchronous?

I have a custom component that has a BlueprintNative event. That event is being called by code from a custom actor. The intention behind the call is to give the component a chance to do any additional custom setup it needs/wants to do in Blueprint before being used. That all made sense to me until I realized, that the event may or may not actually complete before my code continues.

Is a call to a BlueprintNativeEvent, whether it is override in BP or not, a synchronous or asynchronous call?

Basically I have code for example like this:



	newTile->Position = FHexCoordinate{ 0, 0 };
	newTile->Transform = FTransform::FTransform();
	newTile->Dirty = true;
	newTile->Valid = true;
	newTile->OnCreateTile();
        // If the tile hasn't invalidated itself, add it to our list
	if (newTile->Valid)
	{
		this->Tiles.Add(newTile);
	}


In the code, OnCreateTile() is a BlueprintNativeEvent on the component, giving it the ability to have custom stuff done before it is used, and in this case it also has the ability to invalidate itself during that in which case the tile would not be used. I did that with a flag on the component because I am pretty sure events can’t return data.

Blueprint ‘events’ are not like real event, more of a fancy name for a ‘function’. They are all synchronous by default.

Excellent! Thanks.