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 AndersWR · Aug 24, 2013 at 10:37 AM · basic programming

2 hand weapons, using dynamic hands with the razer hydra controllers

Hello. I'm using the razer hydra motion controllers to control two hands. I've been working with one handed weapons which are working fine, but when it comes to using a 2 hand weapon that goes from the left hand to the right hand, I can't figure out how to do it. Basically the sword will have the transform.position of the left hand, with the sword/handle sticking through the position of the right hand, so basically the rotation of the sword would be the position of the right hand.

I've been trying to get RotateTowards to do what I'm trying to achieve, but I can't get it to work, and I'm wondering if it's possible to do this through bones, or having two piviot points on the sword or something. I'm a bit clueless on this task, so any help or guidance is greatly appreciated. As long as I know which method I should use, I should be able to figure this out.

Thanks in Advance

Edit.

more information:

Hi there, I'll try and be a bit more specific. For those of you who are not familiar with the razer hydra controllers, take a look at this link: http://www.youtube.com/watch?v=l714RhwpA28 if you skip to 1 minute inn, you'll see how he's controlling the 2 handed gun with both hands, and I'm trying to do the same, but with a 2 hand weapon instead. Doing this with a one hander was just a matter of parenting the sword to hand, and set the rotation and the position:

sword.transform.parent=LeftHand.transform;

sword.transform.rotation= LeftHand.transform.rotation;

and the sword would automatically map to the hand this way. However I can't figure out how to do the same with a 2 hander, at the moment I've been trying to get RotateTowards to work:

_direction = (RightHand.transform.position-LeftHand.transform.position);

Vector3 newDir = Vector3.RotateTowards(transform.forward, _direction, 50, 50);

transform.rotation = Quaternion.LookRotation(newDir);

But this is not working correctly this is the first time I'm trying to use the RotateTowerds function, so I might not be using it the right way either. So I was wondering if there's another method I should try and use. Sorry if my explanation is a bit vague, but I'm not sure how to explain what I want to achieve in any other way

the commenting section is bugged for me at the moment, so I'll post my comment here:

Is there anyone who knows anything about this matter? I'm really stuck, and I'm not asking for much, I just need to know which methods I could try to achieve what I'm trying to do. Thanks again

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 sdgd · Aug 24, 2013 at 10:37 AM 0
Share

can you give us more details?

like your code?

but basicly you need to verify if you have something in Lhand if if you do than put in right hand.

so you need an IF statement.

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

17 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

Related Questions

String segment comparator 1 Answer

2 Programming Languages 4 Answers

How to make a button go through Gameobjects one at a time.? 0 Answers

Aiming (Rotation) an object to User Touch Input 0 Answers

How to randomly access Vector3's from an array? 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