Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Pibastte · Jan 11, 2018 at 07:54 AM · physicssimulationphysics settingsscaledown

Scaling down my model or scaling up the gravity

Hi, thanks for taking time to help me. I have a simulation of a project, a self driving car that I train on Unity and I would like to scale it to the actual size of the real car we re gonna make (30 by 20 centimeters). The problem is that when I scale it to this size the physics engine acts really weird and the car is shaking. So I thought I just had to scale my car by a factor of 3 or 2 and scale up the gravity by the same amount in Edit/Project settings/physics.

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

3 Replies

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

Answer by calpolican · Jan 16, 2018 at 12:44 AM

Well, the values are made for the scale the car has. Scaling the car down will surley ruin the asset. Are there many other things in your scene? if I where you, I'd just scale up the model of the world instead. Is either that or you try to change all the values for speed and damping, etc that may be in the asset scripts, that may get tricky. I wouldn't touch the gravity at all, that will make a mess.

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 Pibastte · Jan 16, 2018 at 06:50 AM 0
Share

Yes I could scale everything up but I have a real physical model that I want to simulate in Unity so I would like to have the real weight, the real size so that the real model and the unity model behave similarly

avatar image Pibastte · Jan 16, 2018 at 06:51 AM 0
Share

And I dont have anything else in my scene just a ground

avatar image calpolican · Jan 17, 2018 at 09:44 AM 0
Share

Well, if you want to do some sort of physics simulation that will give you an idea of how the actual car will behave in real life, keep in $$anonymous$$d that most probably the car asset is faking the physics a lot. For example, most games don't have a collider and rigidbody for every wheel, they don't have back traction and don't calculate the friction of the wheels against the floor, the wheels just move by an animation whos speed is linked to the car speed. I'm just saying as I don't know how accurate you need your simulation, but keep in $$anonymous$$d that usually game programmers just adjust the parameters to make them feel like something they consider realistic. In that spirit, if you want to use the asset and don't $$anonymous$$d some inaccuracy, you should change the parameters. Obviously you can't make a 20cm car accelerate as fast as a real one, in that case it'll move very weird of course. You'll have to change the speed, the weight, and the rest of the values accordingly to try to match --as best as you can those of your game--. Just saying that in my experience those changes are somewhat tricky. You should try to figure out the formula they use (the proportions), maybe it's comented in the scripts, or maybe the asset is related to some tutorial, in that case, you should probably watch it and see... perhaps you're lucky and there's some built in scaler multiplier.

avatar image Pibastte · Jan 18, 2018 at 05:43 AM 0
Share

ok thank you very much for helping it s a bit more clear for me now. I m gonna check if there is a scalar multiplier but since my car goes really slow I think I m not gonna $$anonymous$$d avout the gravity ;)

avatar image
1

Answer by Dray · Jan 11, 2018 at 10:22 AM

In general, you should always try to keep objects at their real world scale to get the most accurate physical behaviour. Maybe you can counteract the shaking by adjusting the rigidbodys mass and drag values?


I'd also like to ask how exactly you implemented the movement. Can you post a snippet or something? Might make it easier to help you :)

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 Pibastte · Jan 11, 2018 at 12:02 PM 0
Share

Thank you for helping, I simply used the standard asset's vehicle folder where you can find a premade car named car in StandardAsset/Vehicles/car/Prefabs. You can make a scene and put it in very quickly. Try setting the scale to 0.30 by 0.20 and you ll see that when you launch the game nothing behaves right :/.

avatar image Dray Pibastte · Jan 15, 2018 at 11:41 PM 0
Share

But why scale it down? It's meant to be used in its original size I'm pretty sure, did you try scaling everything else up?

$$anonymous$$eep in $$anonymous$$d that physics behave totally different when you look at the same object in different scales

avatar image Harinezumi Pibastte · Jan 16, 2018 at 08:29 AM 0
Share

Do you mean that you use the vehicle game object's Transform and set it to (0.3, ?, 0.2)? In that case, this could be the problem, there are issues with non-uniform scaling in Unity.
Or if you are talking about the scale of the Collider, then the forces that affect the vehicle might be too strong (I'm not familiar with this Standard Asset). Try to check what forces control the vehicle.
One more thing you could try is to make the physics simulation more precise by setting the Fixed Timestep in Edit -> Project Settings -> Time to a lower value, like 0.01 (but be aware that 60 FPS has an update cycle of 0.1666 seconds!).
In any case, I strongly advise against changing gravity scale, Unity and PhysX are designed for "real" world-like physics simulation, and all kinds of bugs pop up when certain values are changed.

avatar image
1

Answer by meat5000 · Jan 17, 2018 at 02:02 PM

Unity lacks an actual per-unit scale and is pretty open to interpretation of what measurement 1 unit should correspond to. The rule of thumb is that your scale is correct when your free-fall gravity responds correctly.

Very large or very small scales should be avoided as they cause problems and strange behaviour.

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

135 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image 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

Adding real life physics behavior on 3-d object. 1 Answer

Simulate physics without rendering 2 Answers

Problem with a ballistic trajectory simulation (rigidbody.velocity) 0 Answers

Using cylinder colliders as wheels. 1 Answer

Physics seem inaccurate with massive amounts of rigidbodies. 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