Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Is there a way to zero world origin to a new location?

I am fairly certain its impossible, but just in case it is - is it possible to set world origin to a new location and have it reset the whole coordinate system to that new location as 0,0,0?

I am making an endless runner, and it would help with precision loss at great distances.

If I am thinking about it wrong, please let me know. Currently I just spawn actor tiles in front of the player based on a trigger volume, and destroy them in the same way.

Product Version: Not Selected
more ▼

asked Dec 22 '14 at 04:40 AM in Using UE4

avatar image

224 16 29 36

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

You have to add existing world origin to new location to zero it to a given coordinate. This effectively resets the world to new location - which is very useful for anyone writing large single player games or endless runners.

Zero world origin

or C++

 World->SetNewWorldOrigin(FIntVector(newO.X, newO.Y, newO.Z) + World->OriginLocation);
more ▼

answered May 24 '16 at 08:12 PM

avatar image

224 16 29 36

avatar image Jin_VE Apr 30 '17 at 12:19 AM

Truncate was what I was looking for. Upvoted.

avatar image MikeRPG Feb 02 '18 at 07:31 AM

mxnko thank you so much for your solution. I never ever would have thought of adding it. It makes no sense why just setting the origin to the actors location doesn't actually set it there.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
setworldorigin.png (17.6 kB)
more ▼

answered Dec 22 '14 at 04:45 AM

avatar image

2.1k 75 37 111

avatar image mxnko Dec 22 '14 at 04:48 AM

SilentX, I've tried it, but it does not shift the coordinate system. It simply anchors world origin to new location at x,y,z.

avatar image PeterLNewton Dec 23 '14 at 06:52 AM

I assumed it did that. I know this can be a problem for infinite runners or games that are large in general. KSP had a talk on it, so I'm familiar with the problem.

Unfortunately I don't have an immediate answer, sorry about that.

avatar image mxnko May 24 '16 at 08:10 PM

@PeterLNewton it appears you're right. But its not as straight forward as just calling that function. I'm posting answer with BP solution.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question