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
0
Question by DylanWilson · May 24, 2014 at 04:13 PM · gameobjectrigidbodypositionaxis

Explain why the y-axis of the GameObject's position is not exactly zero when rigidbody is added to it.

I've created a game object and added a rigidbody to it. In the scene editor/viewer I set its position to 0, 10, 0. And it is scaled to 1, 2, 1. Next, I changed the position of another game object (the floor) to 0, -.05, 0.

After I clicked on the play button, the game object falls down (due to the gravity). After it hits the floor, it does nothing else, which is normal.

I then noticed that the y-axis of its position is not exactly 0 but rather 0.48 and it doesn't change unless I change the y-axis of the floor's position. Can you please explain why? How can we fix it?

Comment
Add comment · Show 3
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 felixpk · May 24, 2014 at 04:49 PM 0
Share

$$anonymous$$aybe there is a little bounce or something like this. Try to apply a Physics$$anonymous$$aterial to your collider with 0 bounce ect. If the GameObject should do nothing more than fall to the ground you yould also freeze the y and x position under the RigidBody settings

avatar image vvkkumar06 · May 24, 2014 at 04:59 PM 0
Share

$$anonymous$$ake sure your object is just above the floor. If it is crossing floor it will fall down.

avatar image DylanWilson · May 24, 2014 at 07:49 PM 0
Share

The object is above the floor and is not moving, which is normal. I am just wondering, why the y-axis is not exactly 0? Also, giving it a material with 0 bounce does not change.

1 Reply

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

Answer by Owen-Reynolds · May 24, 2014 at 08:30 PM

Two things:

1) How thick is the floor's collider? What is the collider y-centering? What kind of collider does the player have? Some are taller than others, or scale funny (spheres, if not all scales the same.) Finding the exact top of the floor collider, or exact bottom of yours, often requires some math.

2) The physics system allows (and, I think, requires) objects to interpenetrate a little bit. Stack some 1x1x1 rigidbody cubes on top of each other, and you'll see the same effect (each will be only about 0.99 higher.) This might be accounting for the 0.02 (0.5-0.48) change.

The setting (I think) is in Edit->Physics->MinPenetation. But feel like setting it to 0 just makes nearly resting objects shake too much.

The amount is consistent. You can usually not worry about it, but accounting for it in code seems to work.

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

23 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

Related Questions

How to determine the direction of an object to the player. 1 Answer

How can I increase or decrease a position based on another variable ? 1 Answer

How to rotate the axis of a 3D GameObject 1 Answer

Take final position after a force applied to a GameObject 1 Answer

Need insight on strange (simple) 2D object transform bug 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