Variable priority?

I have a boolean variable called ‘a’ and change it after the event tick in one blueprint ,and also change it after the event tick in another blueprint.How can i know which one is executed first?And how can i set the priority so that it can make a good result?Thanks!

You can do that by switching tick group, but you can do that only in C++

…but don’t worry it’s easy :slight_smile:
Setup C++ envrament if you don’t have, create class with “Add Code to Project”, use parent class which you used in blueprint. Now in .h add BeginPlay declaration like this in class declaration which “add Code” should make fo you, you just add that single line:

class ASomeClass : public ASomeParentClass
{
	GENERATED_UCLASS_BODY()

	virtual void BeginPlay() OVERRIDE;

};

And in cpp file you add this:

void ASomeClass::BeginPlay() {

    Super::BeginPlay();
	SetTickGroup(TG_PostUpdateWork);
	
}

Replace ASomeClass with you class name and TG_PostUpdateWork you can replace with any tick group (in link you got description on which rendering stage tick is called, pick later one or earlier one):

Build your code (you can restart editor and it will compile changed code if you set up VS2013 right) Now make a blueprint (or change parent of existing one) with this class from C++ as parent class and thats it, that blueprint will have diffrent tick group and it will tick diffrently then other blueprints so you are sure one is after another :slight_smile:

If you puke on sight of C++ or you go problem setting up VS2013, try to describe what you exactly want to do with those bools, maybe we can find some blueprint solution.

Thanks very much!I will try that!

Ah i forgot! Add Super::BeginPlay(); (which calls function in parent class) to BeginPlay function, or else BeginPlay won’t be triggered in blueprint, because in AActor class this function calls ReciveBeginPlay() which is responcle for BeginPlay in blueprint. I updated my anwser :slight_smile: