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 ChrisGeorge · Dec 18, 2013 at 11:07 PM · physicsrigidbodyconstraints

Why are a rigidbody's freeze constraints not working?

I have a rigidbody that is not kinematic and its constraints are frozen but when I collide with a kinematic rigidbody, the rigidbody with the frozen constraints starts moving its position like a force has been applied to it? Why is this? Do the position constraints not work?

UPDATE

I found that it is not when the ridigbody collides with another, but when its parent (a character controller) stops moving that the rigidbody still continues to move.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by highpockets · Dec 19, 2013 at 12:15 AM

Wether parented or not, Rigidbodys will always will always be their own entity. I had this problem once and I chose to add a fixedJoint to the 2 Rigidbodys instead of parenting them. That is one solution. That might not work for you in your case. Another option would be to find out when your character stops and in turn set the velocity of the child that needs to stop moving to (0,0,0).

Hope that helps and if it doesn't, I will try to help you find another solution.

Comment
Add comment · Show 2 · 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 ChrisGeorge · Dec 19, 2013 at 01:52 PM 0
Share

The fixedJoint solution is not a good solution for my project, but I do see how it would work.

I have tried setting the velocity to zero on every update, but it still moves. And I have found out that it only experiences this problem when I have moved some distance from the initial starting position. So far, the only solution I have is setting the local position to the position I need it to stay at.

On a side note, I have found that setting a gameObject's transform position to itself is causing some floating point errors as the value does not stay the same. This might be the source of the problem I am experiencing, since my rigidbody is deep in a hierarchy and the compounding error would be causing it to move.

avatar image highpockets · Dec 19, 2013 at 06:39 PM 0
Share

I'm a bit confused why you want to parent an object that isnt supposed to move to a character collider, which I assume is moving a lot during runtime. This is surely causing the problem. Is the rigidbody with the freeze constraints applied to an object that moves or rotates or gets affected by physics in any way other than with a collision? If it only needs to collide, you should maybe just use a primitive collider or mesh collider (more expensive than primitive collider's, but represents the mesh more accurately).

If the freeze constraints are being switched on and off during runtime, You could be running into bit wise issues. A way to solve that problem is to switch all position/rotation/scale constraints on or off at the same time. FreezeConstraints.All

avatar image
0

Answer by ChrisGeorge · Dec 19, 2013 at 08:56 PM

The project I am working on is a modified version of the Bootcamp unity demo from the asset store. I have a soldier model that has a character controller and skeleton hierarchy. The skeleton hierarchy does not have rigidbody components. I have added a game object to each hand that have a sphere collider and rigidbody. These are the rigidbodies that move without me saying so after I have stopped moving the soldier's character controller.

I thought that the freeze constraints were being toggled before and had them set to the FreezeContraints.All every update, but that did not help either. The only thing that works besides re-positioning them every update is to make them kinematic, but I cannot do this because I need to do collision detection.

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

20 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

Related Questions

Smoothed Particle Hydrodynamics 0 Answers

Freezing X and Y rotation not working (rigidBody) 1 Answer

How can I constrain physics in all directions except one? 2 Answers

OnCollisionEnter isnt called when player lands on object 1 Answer

Rigidbody stuck in corners of Mesh Collider 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