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 Youngapprentice · Nov 16, 2011 at 01:30 AM · transformobjectclip

Having an object clip to its parent

Hi, all! I am currently working on a character. When I hit 'q', he draws his sword from his back, and when 'q' is hit again he places it back on his back. I have the sword be parented to the back/hand on a certain point in the animation. This is all fine and dandy, but the whole time, an idle loop plays in which the character breathes, thus moving his back. The sword changes its relative position a lot, and does not always end up in the hand. This is unpredictable an unacceptable. Is there any way for me to get the sword to clip onto the hand bone of my character? Thanks. And

Cheers! - YA alt textalt textalt text

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by syclamoth · Nov 16, 2011 at 01:41 AM

When you set the parenting for the sword, make sure that it has the correct local rotation and position. If you can't predict exactly where the hand is going to be at the moment that you parent the sword to it, you'll have to put up with a one-frame position jump. If you make sure that the sword is in the right place at the moment it gets parented, you won't have any problems afterwards.

Your other option is to use some kind of IK solver on the hand, but that's getting a little more complex.

Is the sword-drawing animation able to be played when the character is running? If not, think about making it a full-body animation. That would solve the problem, too.

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 Youngapprentice · Nov 16, 2011 at 01:50 AM 0
Share

Yes. It is supposed to :( Also, this is impossible to predict, as I have to set the parenting to trigger at

if animation["DrawSword"].time > 2.5 && animation["DrawSword"].time < 2.7

for some reason, unity cannot pinpoint an exact time, which gives me erratic results.

Are you SURE there is no clipping method? Like somehow parenting it to the hand, but making sure it is at the center of the Hand Bone?

Could I just set the transform to the Hand Bone's transform?

avatar image Youngapprentice · Nov 16, 2011 at 01:57 AM 0
Share

Alright. I figured it out. I add empties parented to the hand and back with position/rotation of where I want to clip them to, and then I set the transform.position/transform.rotation of the sword to it. TADA! OBJECT CLIPPING!

avatar image syclamoth · Nov 16, 2011 at 02:54 AM 0
Share

Very good! That's kind of what I was telling you to do, but you worked it out anyway!

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

How to assign Transform to prefab ? 2 Answers

The position of the object and its changes! Help me can not understand! 0 Answers

How to Align the pieces with different scale? 0 Answers

How can I move an object physically correct around an other object? 1 Answer

Change Script so that the object's position can be modified in the Editor/through other scripts? 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