• 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
0
Question by subcon · Jul 23, 2011 at 08:19 PM · spaceorientationspaceship

Difficulties with "Moving the Space, Not the Player"

OK, I've familiar with the whole Futurama/StarTrek11 concept of moving the Universe around a stationary player. I get it.

I've even been able to achieve this effect using a hacked copy of the Space Flight Sim script.

The problem I am having is a difficult one to get past. Consider this scenario:

  • I've created an asteroid field, full of rocks. I want to fly around in this rocks.

  • I've been able to make the player stay at 0,0,0, but make the asteroid field slowly move towards the player. Its just as visually-convincing as actually moving the player through stationary rocks.

  • The PROBLEM is when i've passed through the asteroids, and I am now on the other side of the field. If I try to turn around and go back, its impossible. I am, after all, stationary. My controls now do the opposite based on my spatial position, and the asteroids continue to move far away, growing ever more out of reach.

Now, I've read a few threads where this scenario is discussed (in one permutation or another) - unfortunately I didn't find any tricks that I could derive into a solution.

I believe what I want to do is very simple for someone who truly understands 3-Dimensional math. I do not understand 3-Dimensional math, but nonetheless I AM making progress with my work. I feel like this one piece could open up a lot of other possibilities for other 'scenes'.

I would appreciate any assistance, perhaps from someone who's done an innovative space game or something similar.

Thank you

Comment
Add comment · Show 9
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 subcon · Jul 23, 2011 at 10:36 PM 0
Share

Here's one example where someone else encountered my problem. See the very last post at the bottom, author: ForceX

http://forum.unity3d.com/threads/52667-Solved-$$anonymous$$esh-shakes-after-moving-1000-units

Note also no one responded =(

avatar image SilverTabby · Jul 23, 2011 at 10:40 PM 0
Share

If it looks the same as moving the player, why aren't you just moving the player? It's simpler, easier, requires less code, and requires fewer computations giving a higher frame rate.

It doesn't matter what you are moving as long as the player can't tell the difference.

avatar image subcon · Jul 23, 2011 at 10:52 PM 0
Share

$$anonymous$$y understanding this was a good idea for massive-area space games. I guess I am just having issues trying to devise a way of staging a good sized solar system so that one celestial object (or group of objects) is in a given scene at any one time. Examples of such objects would be asteroid fields, a planet, a moon, or a sun.

Since they obviously are not all in the same region (nowhere close to each other in reality), it seems good to have space that moves around a stationary player. Distant objects would be smaller scale models that, when approached, would dispose of the current scene, and launch the new, close-up object. At least, this "seemed" like a good approach after all the reading I had done.

Have a better idea? I'm open to anything at this point.

Thanks

avatar image SilverTabby · Jul 23, 2011 at 11:22 PM 0
Share

I also have the idea for a massive-area space game in my head. I haven't started it yet, so I'll just memory dump the technical detail ideas I had in my head:

  • For each system, have a single empty GameObject. Parent EVERYTHING inside the system to that GameObject, including the player when they enter. This way the local coordinates will always have the center of that system be (0,0,0). Repeat on smaller scale for asteroid fields and the like.

  • $$anonymous$$ove ONLY the player. Fewer scripts and movement calculations required. If it's stationary, IT IS STATIONARY. $$anonymous$$oving the world around will require calculations for EVERY object in the world as compared to just a small handful. Also, moving the world ins$$anonymous$$d of the player makes multi-player support impossible.

  • Every 5-10ish seconds on a coroutine (prevents excessive checking), if distance from player to center of system > system size: unparent player; unload the entire system; load the next system;

  • Parenting is your friend. You are going to be moving parents around A LOT in any sort of large-scale space game. If you have a problem, try moving around and adding parents with empty GameObjects and that usually helps a lot.

  • NEVER reinvent the wheel. Look to past games for inspiration. The more obscure the game, the better.

  • Less is more.

avatar image subcon · Jul 23, 2011 at 11:37 PM 0
Share

Excellent, thank you. Some of these considerations have been made, most notably your first item (parenting entire scenes inside of empty game objects).

How does one parent/unparent via scripts? I've never done that.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Collisions on Models... 2 Answers

Prevent 2D spaceship going out the screen 1 Answer

Artificial Gravity "SpaceShip" 1 Answer

Mouse Movement (Tracking) 1 Answer

Constant 3D rotation (torque, angular acceleration, etc) GLOBAL to object in space? 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