UE5, world to meters scale

Continuing the discussion from UE5, world to meters scale:

In case anyone else is stuck on 5.1.1 and can’t move to 5.2 for other reasons, here is a hacky bit of code that worked for me, it seems that the WorldToMeters value isn’t getting read from the same place is is being set:

void UUnrealHelperFunctions::ForceWorldToMeters(float W2M)
{
if (GIsEditor)
{
for (const FWorldContext& Context : GEngine->GetWorldContexts())
{

		Context.World()->GetWorldSettings()->WorldToMeters = W2M;
	
	}
}

}