Editor snap actor to hex grid

Hey,

I have grid of hexagons, I want in Editor to snap movement of some actors to centers of hexes, What I am trying to do:
void AGameSceneUnit::PostEditMove(bool bFinished)
{
Super::PostEditMove(bFinished);

	auto transform = GetActorTransform();
	auto location = transform.GetLocation();

	TArray<AActor*> FoundActors;
	UGameplayStatics::GetAllActorsOfClass(GetWorld(), AGameSceneHexMap::StaticClass(), FoundActors);

	if(FoundActors.Num() == 0)
		return;

	AGameSceneHexMap* pSceneHexMap = Cast<AGameSceneHexMap>(FoundActors[0]);
	if(pSceneHexMap == nullptr || pSceneHexMap->GetHexMap() == nullptr)
		return;

	int32 cube_x = -1, cube_y = -1, cube_z = -1;
	pSceneHexMap->GetHexMap()->PosToHexCube(pSceneHexMap->HexSize, location[1], location[0], cube_x, cube_y, cube_z);
	// cube to world pos
	pSceneHexMap->GetHexMap()->HexCubeToPos(pSceneHexMap->HexSize, cube_x, cube_y, cube_z, location[1], location[0]);

	// row column back to hex center
	SetActorLocation(location);
}

But this code prevent actor movement in Editor at all, I think because location is not changed yet, any idas what I need to use?

So, I found a way to create behavior I wanted, I use PostEditMove to get time when the last movement happened, then in editor mode in Tick() I check this time value for all units - if the were a movement 1 sec ago or later - snap unit actor to hexes and reset time value.

This works only when editor mode page is active, but it’s okay.