I have a class deriving from Actor, with a constructor that looks like:
public class Card : Actor {
public Card(string name = null) : base(name) {
// Set up mesh, material, register events
AddTag("MyTag");
SetInt("MeaningOfLife", 42);
var meaningOfLife = 9001;
var gotIt = GetInt("MeaningOfLife", ref meaningOfLife);
Debug.AddOnScreenMessage(1, 3.0f, Color.Red, $"Meaning of life: {gotIt}; {meaningOfLife}");
}
}
When I play in the editor, it outputs False; 9001 when I'd expect True; 42.
I've played around and moved the GetInt and SetInt calls all over, thinking perhaps it was an object lifetime issue, but I can't seem to get this to ever print out my expectations. Currently I'm instantiating a Card in OnWorldPostBegin(). I've also tried GetBool and SetBool and those didn't work either -- I'm guessing this is broken for all of the method pairs.
The AddTag() call seems to work -- I can see it when I inspect the Details pane with the Card actor selected.
Is this a bug or am I doing something wrong?
I have a class deriving from
Actor, with a constructor that looks like:When I play in the editor, it outputs
False; 9001when I'd expectTrue; 42.I've played around and moved the
GetIntandSetIntcalls all over, thinking perhaps it was an object lifetime issue, but I can't seem to get this to ever print out my expectations. Currently I'm instantiating aCardinOnWorldPostBegin(). I've also triedGetBoolandSetBooland those didn't work either -- I'm guessing this is broken for all of the method pairs.The
AddTag()call seems to work -- I can see it when I inspect the Details pane with the Card actor selected.Is this a bug or am I doing something wrong?