SetPhysicsAsset() does't work like the blueprint node

Hello guys, I was trying convert a project function from BP to C++. This function need to change the physics asset of a skeletal mesh. If i do that with the blueprint node everything work fine but if i try to do the same thing in C++ it does’t affect the skeletal mesh. Can anyone help me? Maybe I’m missing some steps

if (bUseAltPhAt && AltPhAt) 
{
	Mesh->SetPhysicsAsset(AltPhAt);
}

I forgot to declare UPROPERTY()

//Before .h
UPhysicsAsset* AltPhAt;

//After .h
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "MyActor|Settings")
UPhysicsAsset* AltPhAt;