[FIXED] Set World Origin Location only works correctly up to a limited distance. (HELP)

I’m creating an open space world game so I call the tick function for world origin rebasing but it only works correctly up to a limited distance. (FIXED)

FIXED THERE: https://forums.unrealengine.com/comm…in-rebase-tool
:rolleyes:

Please help, I fear I lost 1 year of work for nothing…

Could you reformat your posted code with wrapped code tags? It’s really unreadable to tell if anything goes wrong.

I put it on GITHUB: https://github.com/moipum16/WorldOrigin

Sorry I gave Ctrl A in my code had not come out right

He ment use the


 brackets when you post on the forums. If you notice in the text box theres a bunch of text formating buttons above the forum text box. On the right side is one that is for copying and pasting code and posting it into the forum.

Also is this blueprint code converted to c++ code using the unreal engine built in converter?

I have found that in fact the further away from the absolute 0 point in the world, the repositioning of the origin to my location the less it works correctly, the repositioning of the origin of the world is only working up to a certain distance. It only increases the maximum range before starting the bug in the calculations. But this distance is scaled relatively to the size of the player’s pawn, but if I increase the size of the character, smaller objects will be agitated regardless of location.

this is how I do it



if (GetActorLocation().SizeSquared() > FMath::Square(1000000.f)) {
    GetWorld()->SetNewWorldOrigin((FIntVector)(GetActorLocation()) + GetWorld()->OriginLocation);
}


Could you show me where I could overlay this code for testing?

do you have a c++ class for your character or pawn that the player controls? It would go in there in the tick function.

FIXED THERE: https://forums.unrealengine.com/comm…in-rebase-tool