Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by obi38 · Mar 27, 2019 at 01:32 AM · rotationgunhand

Hand and gun rotation problem, Third Person Shooter

Hello, I'm facing a problem with Unity. I'm working on a TPS game. My problem is that I want to make my character's hand always keep the same rotation (perpendicular to the ground), but the problem is when I play animations sometimes my character's hand rotate and the gun's rotation (gun is attached to hand bone) is not perpendicular anymore. (Sorry my english is very bad, but you can look at the images, may be you will better understand)

Thanks for your help

1.png (115.9 kB)
2.png (124.5 kB)
Comment
Add comment · Show 4
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 dan_wipf · Mar 27, 2019 at 05:54 AM 0
Share

do you want to lock the rotation of an axis?

avatar image obi38 dan_wipf · Mar 27, 2019 at 12:05 PM 0
Share

I honestly don't know what I need to solve the problem

avatar image dan_wipf obi38 · Mar 27, 2019 at 01:03 PM 0
Share

well i guess the problem is, that the gun is a child of the hand. and as soon as the hand rotates, the gun rotates as well. and i bwlieve you only want that it rotates like a air plane does. => gun up and down(like nose up and down) and rotating on the y axis left and right but not the rolling rotation on the z axis

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by dan_wipf · Mar 27, 2019 at 04:30 PM

 Vector3 rot = Quaternion.Euler(transform.eulerAngles);
   transform.rotation = Quaternion.Euler(rot.x,rot.y,0);
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 obi38 · Mar 27, 2019 at 06:30 PM 0
Share

thanks but I tried your solution but it seems that it's doesnt work. $$anonymous$$aybe I don't explained correctly. Basically I just want that my hand bone always keep the same orientation regardless of the forearm rotation. I want that when the forearm rotate, my hand keep an perpendicular orientation compared to the ground. But in the actual case my hand bone rotate with the forearm because the forearm is the parent of the hand bone, and so my hand is leaning to the right or the left following the forearm rotation

avatar image dan_wipf obi38 · Mar 27, 2019 at 07:43 PM 0
Share

ah i see.. that’s over my area.. but have a look for bobe restriction on a axis inside mixamo maybe you get further wirh this

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

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

Changing character X axis rotation so that gun points at target issue 0 Answers

Rotation Flicker in 2d platformer gun 0 Answers

Clamping turret rotation on Y axis not working 0 Answers

How to make all Guns look at the same point 2 Answers

Rotations inside gameObjects 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