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 logan4179 · Aug 06, 2021 at 07:02 PM · quaternionjointsjointaimconstraints

Constraint not totally working after manually overriding a joint rotation

I'm trying to make a 3rd person camera system and I'm so close to having everything working correctly. The issue I'm having is with coordinating vertical camera orbit with vertical sternum rotation while aiming up/down.

In order to do this, as I'm orbiting my camera to look upwards and downwards, I'm manually forcing the "sternum" joint to rotate via code in the lateupdate(). The gun model has a parent constraint component with a source set on the hand, and another source set on an empty gameobject on the player's back. That way, I can have the weapon holstered, or drawn, or anything else I want (multiple parents), and also easily switch out other weapons.

The issue is that the gun rotates "horizontally" with the player, but doesn't tilt upwards/downwards Here's a picture of what I'm getting. The scene view is the right window. The transform gizmo by the hand is the "constraint" object that's parented to the hand joint that the gun is supposed to use as a source for it's Parent Constraint component: alt text

I think what's happening is that the gun's Parent Constraint is happening before the Update() and LateUpdate(), making it act as though there's no override of the joint heirarchy below it, but I'm not sure. I guess this question all comes down to; "Do constraint components do their operations before the lateupdate/do they not update after the lateupdates are finished, and if so, why the hell not?". Many thanks to anyone who can help me figure this out.

3rdpersonpointprob.jpg (183.1 kB)
Comment
Add comment · Show 2
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 logicandchaos · Aug 07, 2021 at 05:33 PM 0
Share

I think constraints only work if you are using physics to move it.

avatar image logan4179 logicandchaos · Aug 07, 2021 at 05:36 PM 0
Share

I think you're thinking of something else. I'm using a "Parent Constraint Component" that's being added to the gun model. This way I can set up multiple constraint sources so that it can be constrained to the character's hand, or holster, or any number of things by adding those objects as "sources". https://docs.unity3d.com/Manual/class-ParentConstraint.html I should add that it works fine normally, but when I override the "vertical" rotation of something higher up in the source's hierarchy, the gun doesn't vertically rotate accordingly, yet it still rotates "horizontally"

0 Replies

· Add your reply
  • Sort: 

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

How target rotation and target angular velocity work in configurable joint ? 1 Answer

Circular Joints? 0 Answers

reading forces applied to a rigidbody 1 Answer

HingeJoint2D.GetReactionForce not working 1 Answer

Configure configurableJoint to act as the disctontinued driveJoint 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