Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Amberite · Aug 26, 2016 at 04:26 PM · rotationscripting beginnerflying

Flying in fixed orbit, could use some pointers!

I'm trying to an Asteroids clone with a twist: instead of moving in 2D, the ships and asteroids will travel in 3D around a fixed point in space, all at a set radius.

I'd like to keep the same sort of trajectory feel from the original game, and I've tried a few different approaches to get the physics to work - but I'm really struggling to find a solution.

My latest plan is this: creating a sphere at position 0,0,0 - that's my fixed point, making my object (let's say ship) a child of the sphere, at a set height (0,10,0)*. Now as the ship is a child of the sphere, if I rotate the sphere on it's y axis, the ship should turn left or right, and if I rotate the sphere along the x axis, the ship will move forwards and backwards. so y = thrust and x = turn.

Any trajectory that I apply will need be applied relative to the world, i.e. if I thrust, then rotate, the ship needs to carry on with the same velocity in the direction it was facing, not how it is now facing.

Once I've figured the ship out, the asteroids/projectiles should be a doddle, just a case of spawning them and having them move in a random rotation (asteroids) or continue on a trajectory(lasers)**.

In my head - this all sort of works, the trouble is I've only been programming for a couple of months and I'm not sure how to achieve lofty goals as above.

I know this might seem like a "Hi, please program my game" post but really, I'm only asking that someone point me in the right direction when it comes to applying all this, so all perspectives are welcome!

  • For those curious, the camera will also be a child of the sphere and set at (0,15,0), looking down on the ship.

  • Yep, you could shoot yourself in the back.

Please note, this question is also on the Physics forum, wasn't sure where best to place it :)

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

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.

Follow this Question

Answers Answers and Comments

76 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

My player spins when I enter play mode. What am I missing? 0 Answers

Starting animation on specific time (%) with scene preview? 0 Answers

flying and using Z rotation (repetitive, but I didnt find an answer for this) 2 Answers

Rotate character 0 Answers

How do i limit the rotation of a game object in relation to a free following camera ? 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