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 SarfaraazAlladin · Dec 19, 2013 at 08:15 PM · jointhingelimits

Hinge joint limits not working.

I'm working on a 2D project, and we're trying to make plants that react when the player walks past. I've used hinge joints at the base of each plant, but the limits I have set (10° and -10° respectively) are ignored and the plants just continue to rotate, until they are laying flat against the ground.

I'm using Spring: spring 10; dampener 0; target angle 0 and Limits: min -10; max 10; min bounce 0; max bounce 0

break and torque are infinite.

Any insights would be much appreciated!

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
Best Answer

Answer by SarfaraazAlladin · Dec 20, 2013 at 08:00 PM

I've Solved it! Though I'm not sure if this is a hack or the intended method.

-Two game objects per plant: The Plant, and a rigidbody

-Rigidbody is moved to the anchor point for the plant, and connected to hinge joint

-Make sure box collider has depth.

The box collider I had attached to my plants was set to 0 on z. Screwed the whole thing up! I set it to 0.1, and viola. Limits are working, but only while connected to the second game object.

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 TSSTUDIOS · May 11, 2014 at 08:19 PM 0
Share

voila voila

avatar image
1

Answer by supernat · Dec 20, 2013 at 06:45 AM

How are you rotating the plants? Are you letting the Physics engine control the rotation somehow? If you manually adjust the rotation, the hinge joint won't work. However, if you're manually adjusting the rotation, why not just limit it right there. Sorry to answer this, comments are broken right now in Unity Answers.

Comment
Add comment · Show 3 · 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 SarfaraazAlladin · Dec 20, 2013 at 04:49 PM 0
Share

(Comments still not working) Thanks for your help! The Rotation is purely physics based. The only components on the plants are rigidbody,hinge joint, and box collider. One thing I hadn't considered when I posted this question: The plants are not kinematic, of course, but the player's rigidbody is kinematic. Would that effect the behaviour of the hinge joint?

avatar image supernat · Dec 20, 2013 at 07:04 PM 0
Share

Unless it is a bug in Unity, I would not think the kinematic state of the player would matter for this particular issue. Now if you told me the plants weren't bending at all, then yes it could be due to the player's kinematic state.

Did you set useLimits to true?

Looks like comments are available again at least!

avatar image SarfaraazAlladin · Dec 20, 2013 at 07:10 PM 0
Share

Use limits is set to true. I'm trying to set up a configurable joint now to see if I can work around it, but I just don't get why the limits are being ignored. Originally I didn't have any other bodies connected, but I've since made empty game objects with rigidbodies, and connected each plant to one. The plants still bend past their limits, but are more restricted now. Still not perfect, but I'm getting somewhere.

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

21 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

Related Questions

Hinge Joint Limits in C sharp 1 Answer

Spring Joint Worm set-up 0 Answers

Weird behaviour with hinge joint 0 Answers

Hinge or Configurable Joint to rigidbody's certain coordinates 1 Answer

Joints 2D, rope 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