Can I make a very large planet with world composition?

I was interested in making an Earth sized planet to fly around in a space ship.

At the moment I have a massive static mesh to fly around, but after flying too far from the origin, everything starts to judder. I understand this is floating point rounding errors but I though the origin shifting would take care of this.

Any one know what I can do to keep the movement smooth?

Hi,

You can use world origin rebasing without world composition. Look at “Set World Origin Location” blueprint node.
So you can track your current position and shift origin when it becomes like 10km away.

Thanks for the answer, however now I have a slightly different issue.

float DistanceFromOrigin = FVector::Dist(FVector(), GetActorLocation());
	if (DistanceFromOrigin > 100000.0f)
	{
		FVector ActorLocation = GetActorLocation();
		FIntVector NewOriginLocation;
		
		NewOriginLocation = FIntVector();
		NewOriginLocation.X = ActorLocation.X;
		NewOriginLocation.Y = ActorLocation.Y;
		NewOriginLocation.Z = ActorLocation.Z;

		GetWorld()->RequestNewWorldOrigin(NewOriginLocation);
	}

This works fine once. But when the player exceeds the max distance a seconds time, the origin gets reset every frame and distance doesn’t reset.

You should add new offset to current origin location, like

GetWorld()->RequestNewWorldOrigin(GetWorld()->OriginLocation + NewOriginLocation);

Ah, thanks for helping me out!