Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Bob Smith · Dec 25, 2010 at 12:34 PM · coordinatesparallel

Parallel levels and composites.

The basic idea for the game I'm thinking about making includes multiple parallel stages per level. Imagine two worlds, 2m by 2m, called world A and world B. Upon hitting the spacebar (or some other key), the player is transported to a "composite" world.something like this:

A:

(1,2) (2,2)

(1,1) (2,1)

B:

(1,2) (2,2)

(1,1) (2,1)

Composite when character is standing on (1,2) or (2,2) from either A or B:

(1,2)A (2,2)A

(1,2)B (2,2)B

Composite when character is standing on (1,1) or (2,1) from either A or B:

(1,1)A (2,1)A

(1,1)B (2,1)B

How would I do this? Everything on the block would need to stay the same. For example, if the player hit the spacebar when the character was standing on (1,2)A and there was a wooden block on (2,2)A, both would need to be transported to the composite world and be on (1,2)A and (2,2)A respectively.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bampf · Dec 25, 2010 at 01:08 PM

There are basically three ways: move everything to the new world, or move the new world to you, or move nothing. It depends on how different the worlds are, what stays the same and what changes.

To move nothing, the two worlds would coexist but you would deactivate and activate game objects. You could also swap textures and shaders to change the appearance of things that aren't moving, but that look different. Scripts could behave differently depending on which world was active. Etc.

To move the player, you'd have the 2nd world off-screen (displaced along the z-axis maybe). When the player swaps, translate the camera, player, and block to the new location.

To move the world, you'd keep the camera, player and block in one spot and move everything else.

That's the idea, and you may have gotten that far in your thinking already. But there's not much more to it than that. For your example you'll need a way to detect what the player is standing on; raycasting from the player downwards is probably the way to go, or maybe you could track which block(s) the player last collided with as they walked around.

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

No one has followed this question yet.

Related Questions

Coordinate confusion 1 Answer

Instantiate and destroy on given location 1 Answer

Scene View - Left-Hand XYZ Coordinates 1 Answer

world and local locations.. 1 Answer

Converting iPhone touch to world coordinates 1 Answer


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