Hi!
When I run the following code:
void ATestUnit::PostEditMove(bool bFinished)
{
if (bFinished && RootComponent != nullptr)
{
auto loc = this->GetActorLocation();
// Should only be allowed to be placed in tiles of a grid
loc.Y = ((int)loc.Y) / tileSize * tileSize ; // couldn't find any fmod function...
loc.X = ((int)loc.X) / tileSize * tileSize ;
loc.Z = 0;
RootComponent->SetWorldLocation(loc);
}
AActor::PostEditMove(bFinished);
}
I get an offset from the xyz arrows to the actor’s mesh representation. However if I just selects the actor again there is no longer any offset for the xyz arrows. It’s not very much of a problem but is this the expected behavior of this code. If so am I missing some update call to the editor or something? (The mesh is the root component node.)