• 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
1
Question by speedb · Dec 15, 2010 at 09:45 PM · mathfloatjointconfigurablejointround

"bleeding" when using configurable joints

Hi, I have a scene with some objects (cubes and/or spheres for that matter) falling down in 2D (XY plane). I Locked the Z motion and checked "configured in world space", and it does seem to work - however there is a strange "bleeding" problem on the Z axis - the Z position changes - but with very small numbers ( -3.312148e-06 and so). Anyone knows why t$$anonymous$$s happens?

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 Statement · Dec 15, 2010 at 10:30 PM 0
Share
avatar image speedb · Dec 16, 2010 at 07:46 AM 1
Share

2 Replies

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

Answer by Proclyon · Dec 15, 2010 at 10:00 PM

Yes I am 100% sure of it aswell!

Floating point values are rounded

I am not sure if you are familiar with scientific decimal notation, please don't be insulted if I do explain, I just can not assume you do :)

-3.313148 * 10 ^ -6 just means the point moves 6 to the left -0.....and so on 3313148

ea

VERY VERY VERY small number

In astronomy t$$anonymous$$s is very common where values are beyond your and my imagination and such notations are not even a choice (Even lightyears really aren't that big). Otherwise you would just run out of paper and pens.

T$$anonymous$$s rounding value is done automatically. You just need to ignore it. The value is infinitesimal and will not have any effect. But I am not 100% sure it will pass a value = 0.0f check. You could check. If so just have a minimum domain of -0.00001f and a max of 0.00001f and clip every 0 measurement between that for the same effect.

EDIT:

That changes everyt$$anonymous$$ng (see below comments). I can only speculate on the cause as your question mentions. Possibly drag on triangles ( wind will always have an effect on triangles with their flat surfaces, no matter how small you make them to build a sphere. 0.001 is definatly not a value to simply be brushed away as irrelevant in t$$anonymous$$s situation I believe. If not so I would never blame rounding on a value t$$anonymous$$s large at least. Well I don't have more answers. But I have an idea. Script a Z-Clip script like I did for rounding. Make the domain between whatever you find acceptable and FORCE the object to always remain in that position by nudging it back.

Comment
Add comment · Show 11 · 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 Statement · Dec 15, 2010 at 10:41 PM 0
Share
avatar image Proclyon · Dec 15, 2010 at 10:50 PM 0
Share
avatar image Proclyon · Dec 15, 2010 at 10:53 PM 1
Share
avatar image speedb · Dec 16, 2010 at 06:06 AM 0
Share
avatar image Statement · Dec 16, 2010 at 01:30 PM 1
Share
Show more comments
avatar image
1
Best Answer

Answer by Statement · Dec 15, 2010 at 10:38 PM

I can't explain it. There shouldn't be anyt$$anonymous$$ng modifying the Z component given the Z starts in 0, and is falling without any velocity or force in Z. It just shouldn't happen. I doubt it is rounding alone because even operations like normalizing the velocity would set Z to 0, since it was 0 to begin with. 0 / whatever is always 0. I t$$anonymous$$nk it might be somet$$anonymous$$ng with the joints code that attempt to maintain its position. Or it can be rotational forces acting on it.

I don't know if t$$anonymous$$s fix or breaks anyt$$anonymous$$ng for you but you can try manually setting z to 0 in FixedUpdate.

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 speedb · Dec 16, 2010 at 07:42 AM 0
Share

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

1 Person is following this question.

avatar image

Related Questions

Is it possible to round down 0.99 to 0? 2 Answers

Float to Int 4 Answers

Joint: Swing & Twist? 1 Answer

Shown decimal places 2 Answers

Math Round? 2 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