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 Destroyd · Feb 19, 2012 at 08:58 PM · mathpathorbitmissile

Suborbital Missile Pathing

I am making a game where you can launch nuclear missiles from various countries around the world. I am struggling to get the missile pathing to be realistic. What I want the missiles to do, more or less, is launch up (away from the center of the earth) and gradually turn until it is in a suborbital path around the earth. When the missile is close to its target, it should essentially do the opposite of its launch movement and fly down into the target. An example of this missile movement can be found in MAD: Global Thermonuclear Warfare.

I've tried a few things to fix it, namely bezier curves. The curves work nicely unless I'm launching from, for example, the north pole to antarctica. If I launch too far of a distance, it shoots the missile through the earth; otherwise it looks great. I've also been pondering if I could devise a way to rotate the missile towards the target (AI vs pathing.)

Does anyone have any insight as to how I'd go about doing this? If I can't fix it, I'll have to use bezier curves and make it so you can't launch from/to antarctica...

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by _MGB_ · Feb 19, 2012 at 10:31 PM

You could maybe use two bezier curves to prevent paths through the earth? Use a midpoint between the launch & target positions (projected outwards to the desired altitude).

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 Destroyd · Feb 19, 2012 at 10:49 PM 0
Share

I should have mentioned that I've tried that already. I actually used three curves with 3 points each (7 points total, two shared.) While it has the possibility of working, I can't for the life of me figure out the math to get each point just right to make it look realistic. The main struggle I'm having with getting those 7 points right are that I am forced to use Vector3 directions vs rotations and it's confusing rotating/putting them how I want. The kind of answers I'm looking for are more in the code/example department, than the idea department.

avatar image
0

Answer by Destroyd · Feb 20, 2012 at 06:52 AM

Well... I fixed it myself. This seems to happen a lot. I'll ask for help and continue working on the problem myself, and usually fix it before someone else has a better idea. Basically what I did is link 3 bezier curves together. The first one with 4 points, the middle one with 3, and the end one with 4. Each curve is linked at one point for a total of 9 different points.

The math for it was a whole lot simpler than I realized. I just started with the beginning, middle, and end points which I derived from knowing the missile's launch/destination points. Then I basically put the other four points between those, normalized them, and made their distance fixed from the earth's center (resulting in a faux suborbital position.)

If anyone wants to see the code for it, I'll be glad to share.

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

6 People are following this question.

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

Related Questions

help with my orbit camera script 0 Answers

Divide a line between two points into lines of smaller distance. 1 Answer

Change orbit while rotating. 2 Answers

-Accurate- following of a Bézier curve 0 Answers

How to create homing missile that follows path using Unity and iTween 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