• 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 mlysbakken · Dec 21, 2009 at 11:43 AM · physicscar

Why can't my car jump off of ramps in a realistic fashion?

I'm working on a simple racing game, and I love the way my car handles while driving on flat surfaces. The problem is that whenever it hits a bump in the road or reaches the end of a hill, the car gets tossed into the sky. It's a bit hard to explain, but it seems like the physics engine thinks the car is driving at a higher speed than it is, so that when it gets airborne it flies way too far. Anyone got any idea how to fix this? I want the car to be able to jump off of ramps in a realistic fashion, but at the moment this just doesn't work...

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 duck ♦♦ · Dec 21, 2009 at 04:16 PM 0
Share

You'll probably have to give more detail about how you have your car set up. For instance, are you using wheel colliders? Can you provide a link to a webplayer example?

avatar image mlysbakken · Dec 21, 2009 at 09:35 PM 0
Share

I can't provide a link to a webplayer example, sorry, but I can go a bit more in detail on my setup. I use wheel colliders, and my car has a low center of gravity. The suspension-thingys are quite long, but I don't remember the exact details. I have the project on another machine, and won't use it until tomorrow, but I can add a more accurate post when I wake up.

I used the script from Andrew Gotow's car tutorial (http://www.gotow.net/andrew/blog/?page_id=78) as reference for my car script and added some code of my own to get better handling. I don't think the problem lies in my own code...

2 Replies

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

Answer by efge · Jan 19, 2010 at 05:18 PM

Started with the same setup from Andrew Gotow's blog and run into similar problems.
After reading Flashbang Studios' Unite article I switched to a setup with Raycast Colliders and now it works.

http://unity3d.com/support/resources/unite-presentations/physics-the-right-way

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 mlysbakken · Jan 20, 2010 at 08:09 AM 0
Share

Thanks, I'll try that! :)

avatar image
0

Answer by runevision · Dec 22, 2009 at 09:47 AM

If the car has the right speed and angle when leaving the ramp, but flies way too far when it is airborne, maybe the gravity is set too low? Generally, gravity is the only setting affecting how fast objects fall to the ground, unless you have some really extreme air resistance settings, or other forces are affecting the car.

Comment
Add comment · Show 6 · 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 Bampf · Dec 22, 2009 at 11:45 AM 0
Share

The scale of the scene also matters. If gravity is set to a realistic value but the scene isn't using the proper scale (1 unity unity = 1m) then that also will look unrealistic.

avatar image runevision ♦♦ · Dec 22, 2009 at 12:35 PM 0
Share

There is not one "correct scale". Units in Unity can represent anything you want. The gravity should be set up to be realistic (if that is desired) for the given scale that is used. So if for example the scene uses (1 Unity unit = 1 cm) then the gravity vector must be specified in cm too.

avatar image mlysbakken · Dec 22, 2009 at 05:08 PM 0
Share

in fact, changing the gravity only seems to affect the speed of the fall, not the length...

avatar image runevision ♦♦ · Dec 22, 2009 at 06:45 PM 0
Share

That should definitely not be true in the general case. Since increased gravity makes it goes downwards faster but doesn't go forward faster, it should hit the ground after a shorter distance. There must be something very specific about your setup...

avatar image mlysbakken · Dec 23, 2009 at 01:24 PM 0
Share

I think the problem might have to do with the gears of my car. I would like to hinder the car from changing gears while airborne, but I don't know how to check if the car touches the ground or not. Any advice? Should I use GetGroundHit or something? $$anonymous$$aybe I'm stupid now, but I'm kind of a newbie...

Show more comments

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

my car keeps fliping over i have an idea how to fix it but i need help 3 Answers

Car tutorial physics models rotating randomly? 1 Answer

need tutorials for rigidbody.Addforce 1 Answer

Car - WheelCollider - Why the side is getting up? 2 Answers

Raycast Car Physics 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