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
0
Question by Graeme P · Nov 30, 2011 at 12:48 PM · physicsmissilerealistic

Effective 2.5D Seeker Missiles?

Hi,

I've been working on a "2.5D," physics game.

The current challenge is getting realistic player seeking missiles.

The player is, lets say a rocket, and is controlled with ridged body gravity, then a key press triggered relative constant force for thrust, along with rotation for changing direction.

For the seeker missiles i started by making them look at player for direction and the just a transform forward vector for speed. But the results were very unrealistic, ugly and just not fun to play - you are dealing with propulsion, gravity and pitch. But these missiles don't follow these rules - so then i lowered the vector speed, added ridged body gravity, and a constant speed thrust like the player has (removing all the vector speed made the missiles completely erratic.)

This produces very realistic looking missile movement, however, because of this fight between transform scripted movement, and physics calculated movement, it has made it pretty jerky, the "look-at" is very sharp, and jitters as it turns, and the trail render is very sharp and jittered aswell.

What i would really like is smooth rotation (with a buffer to limit it from making super sharp turns) and keep this realistic movement but without the nasty side effects.

Can anyone suggest a more efficient & proven way of doing this?

Any help would be very appreciated,

Thanks.

-G

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
1
Best Answer

Answer by syclamoth · Nov 30, 2011 at 12:52 PM

Have you looked at Quaternion.RotateTowards? It seems like it does exactly what you want, here. Combine it with some kind of interpolation, and you're set!

Comment
Add comment · Show 4 · 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 Graeme P · Nov 30, 2011 at 01:18 PM 0
Share

Cool thanks! - That sounds perfect for correcting the rotations. - Any thoughts on a way to combine the constant speed/ridged body physics with the transform.vectors more smoothly? Or a way of faking the missiles air slipping through code alone?

avatar image syclamoth · Nov 30, 2011 at 01:22 PM 1
Share

That's a tricky one, to be honest. You want to be careful when directly interacting with rigidbodies like that- they go erratic if you try to change them in the wrong way. On the other hand, this is basically what missiles in real life have to do- look up some rocket guidance algorithms, and see if you can implement them in your game world!

avatar image Graeme P · Nov 30, 2011 at 01:51 PM 0
Share

Thanks for all your help Syclamoth, Should be plenty to work with now. Was hoping there would be an obvious simple trick to get it working, but this should work about as-well with a bit of trial and error coding. Cheers! =D

avatar image Graeme P · Nov 30, 2011 at 02:04 PM 0
Share

Just thought of a good way to get this working, going to write it here so that i don't forget. XD

  • once i set up the Quaternion.Rotate properly to limit angle change speed and acceleration, i will also add a detector to send messages to my constant force controller in order to set the thrust.

For starters this will be something like,'IF angle change detect <= 5 degrees' - 'thrust equals 100%,' 'IF angle change detect >= 5' - 'thrust equals 10%' - And gravity will still be controlled by ridged body gravity preset.

This should remove the need for a vector speed, and give very realistic and smooth movements, and in much the same style as that of the player.

Cool, thanks a ton Syclamoth!

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Make car CenterOfMass change dynamically 1 Answer

If statment to check if player is within collider 1 Answer

Parenting player to car on click. 1 Answer

Raycast length must be equal to the target distance 2 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