Why Mutator Tag reset to None?

Discussions about Coding and Scripting
Post Reply
Buggie
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Why Mutator Tag reset to None?

Post by Buggie »

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: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Why Mutator Tag reset to None?

Post by Barbie »

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
Godlike
Posts: 2743
Joined: Sat Mar 21, 2020 5:32 am

Re: Why Mutator Tag reset to None?

Post by Buggie »

Thanks, works.
So current best solution:

Code: Select all

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