• 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 sandworm · Sep 06, 2011 at 05:13 PM · rigidbodyvelocityangleprojectiletrajectory

Increase velocity without changing trajectory

I have a rigidbody that has been launched high into the air. I've calculated the exact angle needed to hit a specific target on a distant battlefield, and it works perfectly. Now, however, I have been told to increase its velocity as it nears the ground. Is there a way to increase speed on the rigidbody without messing up the trajectory? The calculation for the trajectory is quite complex, and would be very difficult to modify directly for a sliding velocity.

Thanks! The equation I'm using is below:

 float sqrt = (v * v * v * v) - (g * (g * (x * x) + 2 * y * (v * v)));
 float theta1 = Mathf.Atan(((v * v) + Mathf.Sqrt(sqrt)) / (g * x));
Comment
Add comment · Show 2
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 Waz · Sep 06, 2011 at 05:22 PM 0
Share

Is the increased speed just for aesthetic reasons, or is is supposed to model some real physics (I can't think of any ballistic missile that has a rocket stage at the end!). I've answered assuming it's aesthetics.

avatar image sandworm · Sep 06, 2011 at 08:40 PM 0
Share

Aesthetics. It just takes too long to get to its target the way it is now.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Waz · Sep 06, 2011 at 05:19 PM

If you increase gravity, both g and the actual gravity in the game (or just as applied to the projectile), you will get a higher overall speed.

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 sandworm · Sep 06, 2011 at 05:23 PM 0
Share

Wouldn't that skew the parabolic arc?

avatar image Waz · Sep 06, 2011 at 05:25 PM 0
Share

Not if you change both gravity and the calculation taking gravity into account (I.e. g in you equation).

avatar image sandworm · Sep 06, 2011 at 08:40 PM 0
Share

Any idea how I would go about that? It might not be the best idea though, since there may be multiple projectiles aloft simultaneously.

avatar image Waz · Sep 06, 2011 at 10:43 PM 0
Share

You have g in your equation. Physics gravity is set in Project Settings - Physics.

Believe me, it will work.

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Projectile launch insufficient velocity 2 Answers

Getting startangle for projectile 1 Answer

Angle and Velocity in a Projectile 1 Answer

Rigidbody loses speed 1 Answer

MoveTowards not working the way I'd like 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges