Why are my variables written over?

Writing an automation test, but that shouldn’t matter for the most part.

I have some integers, and 2 of them are not keeping the values I store in them. Here is my current code (with extra unneccesary stuff I am using to debug:

UPROPERTY()
	ARSRPlayerCharacter* PlayerCharacterX = TestUtils::GetFirstPlayerCharacterServer();
	UPROPERTY()
	ARSRPlayerCharacter* PlayerCharacterY = TestUtils::GetAdditionalPlayerCharacterServer(2);
	UPROPERTY()
	int32 StartXPNoBuff = 0;
	UPROPERTY()
	int32 EndXPNoBuff = 0;
	UPROPERTY()
	int32 StartXPBuff = 0;
	UPROPERTY()
	int32 EndXPBuff = 0;
	UPROPERTY()
	int32 PlayerWoodcuttingXP = 0;

	UPROPERTY()
	int32* StartXPNoBuffPtr = &StartXPNoBuff;
	UPROPERTY()
	int32* EndXPNoBuffPtr = &EndXPNoBuff;
	UPROPERTY()
	int32* StartXPBuffPtr = &StartXPBuff;
	UPROPERTY()
	int32* EndXPBuffPtr = &EndXPBuff;
	
	PlayerWoodcuttingXP = PlayerCharacterX->SkillsComponent->GetWoodcuttingXP();

	ADD_LATENT_AUTOMATION_COMMAND(ChopWood(PlayerCharacterX, PlayerWoodcuttingXP, true, StartXPNoBuff, EndXPNoBuff));

	ADD_LATENT_AUTOMATION_COMMAND(Test(&StartXPNoBuff, &EndXPNoBuff));
	
	ADD_LATENT_AUTOMATION_COMMAND(FWaitLatentCommand(5.0f));

	ADD_LATENT_AUTOMATION_COMMAND(Test(&StartXPNoBuff, &EndXPNoBuff));

	ADD_LATENT_AUTOMATION_COMMAND(TeleportPlayer(PlayerCharacterY, FVector(5499.0f, 2848.0f, 215.0f)));

	ADD_LATENT_AUTOMATION_COMMAND(Test(&StartXPNoBuff, &EndXPNoBuff));
	
	ADD_LATENT_AUTOMATION_COMMAND(ChopWood(PlayerCharacterX, PlayerWoodcuttingXP, true, StartXPBuff, EndXPBuff));

	ADD_LATENT_AUTOMATION_COMMAND(Test(&StartXPNoBuff, &EndXPNoBuff));
	
	ADD_LATENT_AUTOMATION_COMMAND(CheckXPImproves(this, StartXPNoBuffPtr, EndXPNoBuffPtr, StartXPBuffPtr, EndXPBuffPtr));

So the offenders are int32 StartXPNoBuff and EndXPNoBuff. They are intiialised to 0, and set (for the time being, it should be 0 and 34 respectively every time) in the first Latent WoodChop function.

They are set correctly, as the Test() latent command shows. The test latent command outputs “Var1: [StartXPNoBuff], Var2: [EndXPNoBuff]”. Here are the values I get out from each time it is run:

Var1: 0, Var2: 34
Var1: 0, Var2: 0
Var1: -2, Var2: 157761904
Var1: -2, Var2: 157761904

I do not use these variables until the final latent command (other tahn my debug commands), so the values should not change.

After taking help from others about, I put UPROPERTY() in front of every variable but that made no difference, have had a pointer variable for each, but this makes no difference, Nothing seems to work.

StartXPBuff and EndXPBuff work exactly the same way, their values are set from within the EXACT same method, however these retain their values and there is no problem with them. Why can I not get this to work for the first 2?