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
2
Question by ZorNiFieD · Dec 02, 2012 at 07:23 AM · physicsgravityjumpspeed

The faster it goes, the longer it jumps

Greetings;

I'm making a temple run type game. The players speed gradually increases. My problem is, I want the jump distance to be the same even if the forward speed is multiplied. For instance, if the player gets so fast, they could jump over 5 platforms, or 10 if I wasn't able to accomplish this.

Currently, for each time the forward speed is increased, I increase the gravity by a variable that I'm playing with, but I still havn't found the right amount. My tests are either too much gravity or too little gravity.

ForwardSpeed = 2 Gravity = 1.5

(increase speed here)

ForwardSpeed = 3 Gravity = 2

How do you think I can achieve the same jump distance? Is there some type of equation I could use to make this happen?

Comment
Add comment · Show 1
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 ZorNiFieD · Dec 02, 2012 at 12:15 AM 0
Share

also, i'm very new to unity and 3D ga$$anonymous$$g creating, only been learning for last 30 days.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by MarkFinn · Dec 02, 2012 at 02:16 PM

I've seen this one before. It's a bit trickier than it looks. Remember, if you increase gravity then the jump will have a lower trajectory, even if you get the distance right.

To have the same jump arc at higher horizontal speed you must modify both gravity and initial upward speed.

Been forever since I did this, so I've lost the base maths, but from my on code, looking back...

  1. Take max height of the jump as a constant [H]. (In meters)

  2. Take normal jump distance (on the flat) as another constant [D]. (In meters)

  3. Time (In seconds) to spend in the air [T] = current horizontal speed (In meters per second) divided by [D].

    Gravity (in meters per second per second) [G] = (2*H)/(([T]/2)^2)

    Vertical jump speed (In meters per second) [V] = [G] * [T]/2.

Hope this helps. (Hope I've read my old math notes & code right (I was a lousy commenter back in the day).

Comment
Add comment · Show 3 · 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 ZorNiFieD · Dec 02, 2012 at 02:31 PM 0
Share

thank you for this, I didn't think of modifying the jump speed at all. I'll try to get this working here shortly and post my success script.

avatar image MarkFinn · Dec 11, 2012 at 11:52 PM 0
Share

Assu$$anonymous$$g this worked out ok, don't forget to set the question as answered/select the answer.

avatar image Jesdisciple · Feb 08, 2013 at 07:38 AM 0
Share

Thank you!! Finally, a jump that doesn't look like insane levitation skillz.

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

12 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

Related Questions

The faster my character goes the longer he jumps. 1 Answer

What is the best way to map the curve of a jump? 1 Answer

My jump script doesn't work every time 3 Answers

I have a planetary gravity script; how do I make the object speed up? 1 Answer

Constant speed when free-falling... Why?? 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