Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 EndUser · Aug 09, 2015 at 11:02 AM · rigidbodyvibrationshaking

RigidBody vibration on Terrain?

Salut!

I have this problem with Unity3D 5.1.2f1:

http://youtu.be/y4pkJMU8wXc (watch since 0:0:10).

The scenario of video is: start the game, apply controls and watch tank positions, then release controls.

This video is captured from Editor screen, so no camera shaking is related to this issue.

The script I use is here:

http://pastebin.com/W1Sx1wKd

The situation briefly:

1) I have my armour shaking infinitely on some terrain positions. The armour can vibrate or can stand still, depends on things unknown to me. Must move several times to see the effect.

2) RigidBody parameters of all three tanks are the same:

Mass = 30000;

Drag = 0.1;

AngularDrag = 4;

UseGravity = true;

IsKinematic = false;

Interpolate = whatever possible variants, does not matter;

CollisionDetection = whatever possible variants, does not matter;

Constraints = RigidbodyConstraints.None;

2) I used transform.Translate/Rotate, I used RigidBody.MovePosition/MoveRotation, I used RigidBody.ApplyForce/ApplyTorque: no difference in the result.

I used Update() and FixedUpdate().

Any variant gives armour vibration.

3) I have tried all PhysicMaterial combinations between Terrain and Armour. I tried absence of PhysicMaterial too.

I have tried to tweak Physics\Bounce Threshold, Sleep Threshold etc.

4) However, if the armour starts on the Cube (you can see it is on the right of video), the RigidBody behaves well without any vibrations or shaking.

Terrain is just plain 2km*2km and with standard grass texture. Nothing more.

Whatever I do, the bug is here. The more complex project becomes, the more amplitude of vibration is and more often vibration comes (up to constant vibration).

It looks like bug appeared in some 5.1.1 or 5.1.2. I haven't encountered it earlier.

Here is the project https://www.sendspace.com/file/yegx5h

What can I do to eliminate this shaking/vibration?

Thank you!

Comment
Add comment · Show 13
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 Positive7 · Aug 09, 2015 at 11:14 AM 0
Share

Possible because whatever you use too move/rotate the tank, gets called every frame and its float value never equals zero so its shaking. You can set its Rigidbody to $$anonymous$$inematic if there's no user Input. Or use Velocity to move the Rigidbody. I'll setup a teest scene now to check it out.

avatar image EndUser · Aug 09, 2015 at 11:19 AM 0
Share

I tried AddForce(Force$$anonymous$$ode.VelocityChange) too. Shaking bug encountered.

I tried to make RigidBody $$anonymous$$inematic = false, apply transitions, then $$anonymous$$inematic = true. The only result is the tank falls from the platform very slowly (it looks like gravity decreased).

I tried

 if (!$$anonymous$$athf.Approximately(velomod$$anonymous$$yDriveNew, 0)) //execute motion.

as you suggested. No result. RigidBodies still can vibrate infinitely.

avatar image Positive7 · Aug 09, 2015 at 11:39 AM 0
Share

Hmm. Can't seem to replicate the issue with a Cube or a quickly made tank in 3ds max (A cube and something that looks like the wheels etc...) If I got anything will let you know. The script works fine here btw (Unity 5.1.1f1)

avatar image EndUser · Aug 09, 2015 at 11:52 AM 0
Share

https://www.sendspace.com/file/yegx5h These are not quite $$anonymous$$e, they're Inspond's, so I don't quite have the right to distribute them as a product ;-) No, wait. I can!

avatar image Positive7 · Aug 09, 2015 at 12:15 PM 0
Share

The shake happens cause the rigidbody still gets transform position / rotation force from Fixed Update. You can avoid it with something like this (bit dirty solution tho):

 void Update()
     {
         if(Input.GetAxis("Vertical") != 0 || Input.GetAxis("Horizontal") != 0){
             this.GetComponent<Rigidbody>().is$$anonymous$$inematic = false;
         }else{
             this.GetComponent<Rigidbody>().is$$anonymous$$inematic = true;
         }
     }
Show more comments

0 Replies

· Add your reply
  • Sort: 

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

25 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

Related Questions

How to make Rigidbody detect collisions but stop its movements 1 Answer

Elevator vibrating!!! 1 Answer

Multiplayer Rigidbody Vibration 2 Answers

rigidbody vibration 0 Answers

Enemy vibrates when it reaches the player 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