Why Mutator Tag reset to None?

Discussions about Coding and Scripting
Buggie
Adept
Posts: 421
Joined: Sat Mar 21, 2020 5:32 am

Why Mutator Tag reset to None?

Post by Buggie » Sat Jul 11, 2020 12:30 pm

I spawn Mutator.
I set Tag in defaultproperties.
During game Tag is None.

I set Tag in PreBeginPlay.
During game Tag is None.

I set Tag in PostBeginPlay.
During game Tag is None.

I output tag in PreBeginPlay and PostBeginPlay. Tag not None.
During game Tag is None.

I ended with

Code: Select all

event Tick( float DeltaTime ) {
	if (Tag != '') return;
	Tag = 'MyAwesomeTag';
}
But curious why this happen? Something set Tag to None after game start. But what?

User avatar
Barbie
Godlike
Posts: 2069
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Why Mutator Tag reset to None?

Post by Barbie » Sat Jul 11, 2020 1:51 pm

I cannot answer your question, but setting the tag in the beginning of an auto state could set it permanently.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

Buggie
Adept
Posts: 421
Joined: Sat Mar 21, 2020 5:32 am

Re: Why Mutator Tag reset to None?

Post by Buggie » Sat Jul 11, 2020 1:59 pm

Thanks, works.
So current best solution:

Code: Select all

auto state Idle {
Begin:
	Tag = 'MyAwesomeTag';
}