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
2
Question by JTown 1 · Jan 26, 2011 at 12:27 AM · limitconfigurablejointlocked

In script, how to set ConfigurableJointMotion to locked without it reseting to default position

I need to set ConfigurableJointMotion to locked for one frame, but when it locks it resets the position to the default position -- is there any way I can have it lock to the current position instead? For extra clarification, it goes Limited>Locked>Limited.

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 JTown 1 · Jan 26, 2011 at 01:40 AM 0
Share

I'm thinking perhaps ConfigurableJoint.targetPosition is where it'll reset to, so I need to figure out how to make the current position the targetPosition..

avatar image JTown 1 · Jan 26, 2011 at 02:02 AM 0
Share

ConfigurableJoint.targetPosition doesn't seem to control where locked joints default to... :(

avatar image stevesan · Aug 22, 2011 at 03:05 AM 0
Share

I would like an answer for this as well. The targetPosition is only used for the drive/motors. I imagine there is a way to do this...? Or can we just destroy/create the joint? That seems like a sub-optimal way of doing things...

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Jean-Fabre · Jan 26, 2011 at 05:48 AM

Hi,

You can't lock and expect the joint to stay in its current state unfortunately ( very, very unfortunate actually...), the solution is to compute the actual current position manually ( yes, another very unfortunate miss...), then you'll be able to "lock" in place safely and reliably.

Computing the current position is very dependent on your rig, so it's difficult ( at least for me...) to give you a scripted answer to your problem, if you can share a project, then I can definitely look at it.

You can see an example of this with an excavator simulation where all arms joint goes from limited to "lock" back and forth following user's inputs.

Bye,

Jean

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 jkraptor · Aug 27, 2015 at 04:17 PM 0
Share

@$$anonymous$$ Fabre : I am able to compute the euler angles of the configurable joint, and I want to lock it in place with the current angles rather than add a fixed joint, later to be destroyed. You mention in your post above there is a way to do this:

"the solution is to compute the actual current position manually ... then you'll be able to "lock" in place safely and reliably"

Could you explain?

avatar image Jean-Fabre · Aug 28, 2015 at 05:41 AM 0
Share

@$$anonymous$$raptor

I have distributed a working solution as a small package on my excavator thread ( Unity 4 only for now, waiting for Unity 5 fixes for proper port...) , here is a direct link.

Basically, you set the TargetRotation property when the joint is at rest, or when you drive it, you use TargetAngularVelocity

Bye,

$$anonymous$$

avatar image
0

Answer by JTown · Jan 27, 2011 at 06:32 AM

I think I found a decent solution myself. I leave the existing joints alone, but add a fixed joint for the frame I apply force (then destroy the fixed joints). I still need to tweak everything though... it seems like I might have to apply torque across multiple frames to get what I want.

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
avatar image
0

Answer by stevesan · Aug 22, 2011 at 11:47 AM

OK I just tried something crude, but it seems to work quite alright: When you want to lock things in place relative to each other, destroy the ConfigurableJoint and create a FixedJoint! Then vice versa when you need it to move again. This will require you to modify your calculations so things are relative to the current position, etc., but that's all doable.

It seems silly that we can't just modify the "rest position" of the ConfigurableJoint (maybe there is a way?)...

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
avatar image
0

Answer by SuperUltraHyper · Oct 12, 2017 at 11:52 AM

I just: rididBody.freezeRotation = true;

then false is when I want it to rotate.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Configurable joint with asymmetric yMotion limit 0 Answers

ConfigurableJoint Object snaps back to old position when AngularMotion locked 2 Answers

Two way joint? 1 Answer

2D Platformer and Character Creation 0 Answers

How Attract Caravan,Cargo with car ? 1 Answer


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