Origin rebasing questions?

hi to all… i have some question about enabling origin rebasing…

when activated, does the world origin shifts all the time whereever the camera is moved?
then, if i have built a 40x40km map, and is at the edge… what if i want to spawn something at the far opposite edge, wont the spawn actor at world location work not properly?.. or do i have to adjust accordingly… new origin + distance to original origin 0,0,0 + target world location ?

No, you need to set the position of your new world origin, continuously moving the origin would take a serious toll on performance i assume.

If you want to stay centered, you need to make the world around you move in your referential.

Accessible with blueprints:

after experimenting… the origin seems to move along with the player pawn…
teleported to far edge, and the origin is set to player pawn’s position…
note that i have checked the option in Enable World Origin Rebasing…

maybe when the camera is too far away, it automatically set the new origin

tried going back to original 0,0,0 origin, but i never got back…

then
tried spawning something at the far edge, wont spawn, unless i disable “enable world bounds check”
after that, i can spawn at the far edge " x-2999830.0 y640980.0 z210.0"

then after moving my pawncamera to that location…
the origin rebasing kicks in…

and now when i teleport to 0,0,0 it’s x-2999830.0 y640980.0 z210.0 <- this is the new 0,0,0

so, if i want to use the old world location transform, should i reference the old 0,0,0 vector and add the new origin vector to get the new vector location?

The origin does not move along, you set it.

Here i’m playing at 21 000 km using world Origin Rebasing (2 100 000 000 Unreal units) :

thank you for the nice vid @MaximeDupart
if i may ask, what function did you use to set the new origin ? :slight_smile:

The demo project can be downloaded in this thread:

https://forums.unrealengine.com/community/work-in-progress/81424-pull-request-world-origin-shifting-in-mp

directlink: https://drive.google.com/file/d/0B08jTAtYhBTyb2VDcnBDdEdEb0k/view

UGameplayStatics:SetWorldOriginLocation can be accessed via blueprint.

Project was dated, made a 4.23 demo project for Multiplayer Origin Rebasing:

thanks for this… will check it out…

now i wonder, with origin rebasing, so you have new origin, what if you want to spawn something far off, can you get the offset for the new world location ?

the spawning of object is in the demo project :wink:

copy that, looking to it now…

so…

  1. Rebase Local Origin To Zero gets an input location that could be anywhere or possibly shifted origin location, and outputs the real world location coordinate ?
  2. Rebase Zero Origin onto Local gets an input location that could be anywhere or possibly shifted origin location, and outputs the location that is not real world location but using the shifted origin ?

confused*
the sample was being used for multiplayer, and goes thru some server related conversions…
like shortcut Z- spawns a replicated object, first it converts the coordinate with rebase local origin to zero, then converts it again with rebase zero origin onto local then spawns the object…

after a few experiments… i can say that, i think… the rebase local origin to zero and rebase zero origin onto local is useable only for multiplayer?..

so, my problem was, if i have a vector ( LOC A )=(x200,000 y100,000 z200)… and origin is 0,0,0 i can spawn a cube properly on that specific location
then, if origin shifted automatically… and try to spawn something at LOC A… it will not spawn to the original location but spawn using the new origin…

somewhat of a resurrection.

ergo, and I think this is what I need to do to get a viable solution.
you need to memorize that initial location and offset the values of the teleport accordingly.

My issue is actually that I’m attempting to use the player start location of the persistent level for LOC. But the initial player start already offsets the world, so the initial offset value is gone. However the docs say this

So maybe the function can be used to apply and get the current world relative position…

In the end the issue was the index of my array rather then the math.
In .25 the basic math is enough to offset things

how did you overcome this problem. @MaximeDupart
im also using 4.23 and i simply copyed and pasted. (switched P with tick)
projectsettings and editorsettings are also the same.

[video]https://i.gyazo.com/386416ee735f64cadf9e3a645afa2ce0.gif[/video]