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 /
avatar image
0
Question by RiverThomas · Feb 24, 2017 at 09:49 AM · c#vrunity5

Can't find child objects of Vive controllers?

I'm using a Vive, with the official SteamVR plugin. Some objects are childs of the controller object, to make them attached to the controller, however since they're used for gameplay I'm trying to find them from another script using GameObject.FindGameObjectWithTag() in the Start() function, only this doesn't find the objects.

I think this may be caused by the controllers being inactive when they're not found, and them possibly not being active/found in the first couple frames in the game, though I'm not sure. What would be the best possible way to find these objects from the other script?

I've thought about using a getchild function, but there are objects in other objects in other objects in the controller, and it feels like a way too hard coded way to just get the child of a child of a child. Another solution could be making them serializedfields and then referencing them myself from the editor, but that also seems like it's more work than it should be, as it used to just work with FindGameObjectWithTag().

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
1
Best Answer

Answer by $$anonymous$$ · Feb 24, 2017 at 12:49 PM

If you are using the steamvr plugin they should be there in the Player Prefab as hand1 and hand2. You could then assign their transforms to a public property on your class. Otherwise perhaps use an IEnumerator for your Start return value and return yield wait until the controllers show up.

Comment
Add comment · Show 1 · 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 RiverThomas · Feb 27, 2017 at 01:48 PM 0
Share

I am currently indeed assigning their transforms to a public, but I'm trying to find a way to hide them, because the inspector is getting quite full. And besides, this used to work, only after creating a new project which literally started as a duplicate, it doesn't work anymore... Going to try using an IEnumerator like you suggested, thanks!

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Manipulating the location of the VR controllers (Vive/SteamVR) in script 0 Answers

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

How to control damage output. 0 Answers

Separate Objects after Mouse Clicking in Unity 5.6.4 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