Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Konash · Oct 18, 2016 at 09:04 PM · physicsdoorhingejoint

Doors and Hinge Joints

Please see the GIF image. Why does this HingeJoint behaves like this? It has a -90,90 limit. And uses Spring.

I want it to stop and the -90,90 angles even if I push it.

Any idea what could be the cause?

GIF: http://imgur.com/mn1oiu8

Image of Joint Settings: https://i.imgur.com/9Vln5kU.jpg

Comment
Add comment · Show 4
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 Sergio7888 · Oct 18, 2016 at 10:11 PM 0
Share

Don't use Spring, as the name said it is for spring effect.

avatar image conman79 Sergio7888 · Oct 18, 2016 at 10:29 PM 0
Share

It's for a spring effect within the hinge joint. It's not supposed to act like a spring joint.

avatar image Konash Sergio7888 · Oct 18, 2016 at 10:36 PM 0
Share

I want it to spring back. Removing the spring yields the same problem.

avatar image conman79 · Oct 18, 2016 at 10:20 PM 0
Share

How are you moving your character? If you're using transform.translate or rigidbody.moveposition ins$$anonymous$$d of rigidbody.addforce it's probably the cause. If you're "forcing" the character to move past the gate's spring limit something has to give, either you pass through the gate or the hinge breaks. Unity favors hinge breaking in this case.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Qvothe · Oct 18, 2016 at 10:19 PM

Without seeing your code, I'm going to assume it has something to do with your door/gate's parent object. As your gate is a child of the pillar, then your bounds are going to be relative to the pillar (the parent object), and not worldspace.

On the second picture, under "Motor" you've checked "use limits" but right above that you do not have "Use Motor" checked. I don't know how the code is written, but I would assume that the limits on the motor don't apply unless you're actually using the motor.

Also, I know it should be obvious, but check to make sure that you're putting your bounds on the correct axis, and set them to 89.5 degrees instead of true 90. A player won't notice the difference and it'll stop any clipping issues you might run into as well. I mention this because your joint settings in the editor do not specify which axis is being "locked".

You should also check your "lock" on the translation, as that could be another possible source of problems.

If it were me, what I would do is remove the collider from the door itself. I would put a proximity collider around the door with a listener. When your player's collider enters the door collider, I would have it trigger a "door opens" animation.

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 conman79 · Oct 18, 2016 at 10:35 PM 0
Share

The child/parent setup seems to be set up correctly from what I can see.

Limits and $$anonymous$$otor are different things, you can use limits without the motor.

The rigidbody constraints are clear in the image?

Who says he's using a translation?

An alternative method isn't really an answer to a specific question.

Sorry if I'm co$$anonymous$$g across a bit harsh, but that answer is full of misinformation and speculation.

avatar image Konash · Oct 18, 2016 at 10:40 PM 0
Share

No code involved in the problem I mentioned. All relevant information is supplied in the image and the GIF.

The limits are not limited to $$anonymous$$otor. The limits actually work if I use AddForce on the door. But when I use a character with a collider, this is what I get.

I double checked the axis. It is correct.

Doing an animation is one solution, but not the ones I want atm sadly :(

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

89 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

Related Questions

Hinge Joints ignore limits 0 Answers

Hinge Joint Breaks When LocalScale is Changed 3 Answers

door animation physics 1 Answer

Creating draggable hinge joint 1 Answer

Accurate weighing scales using hinge joints and rigid bodies 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