Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Benjamin 2 · Mar 06, 2011 at 02:08 AM · terrainwrap

Wrapping A Game Map..

When I get to the end of a map, how do I get it to wrap around on all side making a spherical illusion?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benjamin 2 · Mar 06, 2011 at 02:14 AM 0
Share

Also should work in 3D...

avatar image DaveA · Mar 06, 2011 at 08:23 AM 0
Share

2D and 3D are very different problems. A 2D map can tile easily, a 3D map can wrap a sphere (has its own set of problems), or fake that (has another set of problems). What's your specific need?

avatar image Benjamin 2 · Mar 06, 2011 at 04:03 PM 0
Share

You cant edit a sphere like a terrain, so I am planning to make it look like a sphere by wrapping it on all sides, and putting a fog particle system by the edge to cover the wrap. How can I do this?

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by DaveA · Mar 06, 2011 at 05:27 PM

I've not tried this, but you could see if it works for you: make your terrain, then make 8 more copies of it to surround your original which is in the middle. Then limit movement (colliders I would think) to stay inside that middle tile, but they could see the edges of the other tiles. You'd of course have to edit the terrain itself so the edges match up smoothly. To get them to 'wrap' (if they keep moving to the right, they'll be tossed back to the left) you'd need to set the player transform.position to the other side of the tile. You might also use a collider (OnEnter) to detect that the player has entered and do this to 'teleport' him back to the other side.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Benjamin 2 · Mar 08, 2011 at 12:49 AM 0
Share

I tried that but but its to much work to get everything the same as a normal terrain, I am trying to wrap the map to say, stepping of the edge and getting transported to the other side of a large terrain.

avatar image
0

Answer by mightyenigma · May 19, 2011 at 07:27 PM

I have gotten this to work in UDK using portals. I don't know if Unity has portals or not. It would be FAR better if you could define the world size and the engine would just wrap the transform of all actors crossing the boundaries.

One note though: this is not spherical behavior. If you run off the north end of a true sphere, you would come back on the north edge, but your east/west position would be mirrored, and your north-south orientation would be flipped.

The usual behavior in RPG world maps that wrap around a square is more like you're on the surface of a donut/torus. This means if you run off the north end you come back on the south. It's very intuitive, player-friendly, and easier to implement, but not geographically correct if you're representing a world globe :)

In my opinion, though, player-friendliness is more important than realism, and often easier to implement.

I came over here looking to see if Unity could do what UDK does not, that is, wrap the world boundaries.

I had the same idea as you guys earlier with making 8 adjacent duplicates of the terrain. However, our game requires other things to be moving around the world and crossing over the wrap boundaries. Just duplicating the terrain and having the objects pop over to the other side would result in a lot of cases where other guys seem to disappear from in front of you if you chase them across the boundary. Not cool.

See if Unity has world boundary wrapping of some kind, and if not, see if it has portals. I've gotten the portal thing to work in UDK, but it's got issues near the corners where the portals touch. Maybe it's because I'm letting them overlap....?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by mightyenigma · May 19, 2011 at 07:33 PM

wrapping a world to a donut or sphere is NOT high tech. It's been around for height maps (terrain) since 1985 at least (Rescue on Fractalus).

I thought about why these high-end game engines can't do it, and I think the answer is that all the stuff that's been built around the core is so dependent on the paradigm of a first-person shooter taking place in rooms, that you'd have to redesign the engine almost from the ground up for all the dev kit stuff to work with the wraparound capability. Hopefully this is not the case, as it's a relatively simple feature to implement if you were creating your own engine from scratch.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by FredrikAK · Jun 08, 2012 at 07:48 PM

If you have Unity Pro, this effect is easily achieved using render to texture

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Positioning Unity Terrain 1 Answer

Changing terrain texture at runtime 1 Answer

Decipher 2 lines of code please 1 Answer

Is there way to see component as code? 0 Answers

Problem With Enemy AI 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges