Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 Lennyy96 · Jul 06, 2021 at 04:04 PM · noobconfigurablejointtargetrotation

offset on Configurable Joint target rotation

Hello, I want to have an offset (-90 on z) on the rotation. How can I do that? This is my script:

 public class CopyMotion : MonoBehaviour
 {
     public Transform targetLimb;
     public bool mirror;
     ConfigurableJoint cj;
 
     // Start is called before the first frame update
     void Start()
     {
         cj = GetComponent<ConfigurableJoint>();
     }
 
     // Update is called once per frame
     void Update()
     {
         if (!mirror)
         {
             cj.targetRotation = targetLimb.rotation;
         }
         else
         {
             cj.targetRotation = Quaternion.Inverse(targetLimb.rotation);
         }
     }
 }

Thanks for help!

Comment
Add comment · Show 1
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 Captain_Pineapple · Jul 06, 2021 at 04:06 PM 0
Share

what offset? rotation? position? local? global? which end?

Please give more and exact details on what you are searching for...

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by rage_co · Jul 06, 2021 at 04:12 PM

i don't know Quaternions well so you'd have to figure the format out yourself or wait for a more educated answer....but i think your should do

 cj.targetRotation = targetLimb.rotation - new Quaternion.eulerAngles(0f ,0f, 90f);

i think it should do...but if it doesn't try

 cj.targetRotation = targetLimb.rotation - new Quaternion(0f, 0f, 0f, 0.5f);

I am not well acquainted with quaternions so i do not know the accuracy of these....i hope this works tho...tell me if it does

Comment
Add comment · Show 4 · 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 Lennyy96 · Jul 06, 2021 at 04:16 PM 1
Share

Both didn't work for me but thanks :(

avatar image rage_co Lennyy96 · Jul 06, 2021 at 04:17 PM 0
Share

well then please tell Captain pineapple the details of the problem in the comments for the question....he can help you

avatar image Lennyy96 rage_co · Jul 06, 2021 at 04:32 PM 1
Share

I looked a bit more in the internet and then I saw you have to multiply it not add or deduct it. So I changed the - with *

Show more comments

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

125 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 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

Set ConfigurableJoint targetAngularVelocity towards targetRotation 0 Answers

How does ConfigurableJoint's TargetRotation works? 1 Answer

Getting a configurable joint to point at another object 2 Answers

Configurable Joint - How does TargetRotation work? 2 Answers

How do next steps of script only one time use real time(Time.time)? 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