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
0
Question by Big-Sol · Oct 12, 2016 at 11:01 PM · rotationvrsword

(Vive Question) How do I snap a sword to the right position and rotation?

Okay, so I have a game where you can pick up all sorts of objects. This is done by parenting the object to the controller. Simple enough.

I want some objects, like notes, bottles, etc. to be freeform, in that you can grab and rotate them however you like. Other objects, like weapons, should always align to the controller so that the grip of the weapon lines up with the controller so it can be easily used.

The issue I have is that most of my weapon models have a center and/or rotation that doesn't align properly, so simply telling the newly-childed object to align to its parent doesn't work. The obvious solution would be to create a child on the sword that acts as the "grip point," but I have no idea how to get the script to actually use that point as the root. Creating an object and making the sword its child had no effect.

I'm at a loss, here.

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 brussell757 · Aug 09, 2017 at 03:03 AM 0
Share

I am in this exact same situation. What I did is not perfect but it works... Somewhat. I put an empty gameobject as a child of each controller and positioned it's transform in the desired location. Then on each gameobject that needed to be snapped I put an empty gameobject as a child and adjusted it's rotation to the appropriate rotation. Then in my grab script attached to my controllers I basically set the gameobject's position to the position of the empty gameobject attached to the controller. And then set the gameobjects localEulerAngles to the localEulerAngles of the empty gameobject I added as a child of the gameobject.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Fix rotation skipping 0 Answers

HTC Vive - VR Circular Drive resets object's rotation 0 Answers

What is the vr head input for google vr sdk v1.130 0 Answers

Game object rotate with the camera on y axis 0 Answers

Minor issue with a VR head tracking script to control the camera? 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