Forum Discussion
KevinLongtime
9 years agoHeroic Explorer
(SOLVED) Objects Grabbed Lose Parent When Using Artificial Turning (Video Included)
SOLVED! FIX HAS BEEN UPDATED IN OP OF THIS THREAD: https://forums.oculus.com/community/discussion/47204/avatar-grab-sample-available-unity
Issue Occurs at 0:18
https://www.youtube.com/watch?v=j0teT5IL3E8
Anything I'm overlooking? Tried parenting the avatar system to a bunch of different things and it doesn't solve this yet. Not only does it mess up an object you current have held but it messed up the detection for picking up other objects in the scene unless you resent orientation.
Issue Occurs at 0:18
https://www.youtube.com/watch?v=j0teT5IL3E8
Anything I'm overlooking? Tried parenting the avatar system to a bunch of different things and it doesn't solve this yet. Not only does it mess up an object you current have held but it messed up the detection for picking up other objects in the scene unless you resent orientation.
5 Replies
Replies have been turned off for this discussion
- KevinLongtimeHeroic ExplorerGreat news, thank you so much @imperativity for responding and looking into it! Been dying to setup a little scene you can walk around in artificially and still use your hands.
Happy Holidays! - KevinLongtimeHeroic ExplorerFirst of all thank you for taking the time to help!
I wish I was more fluent in coding because I'm having a hard time figuring out where you want me to put those new values. Tried a bunch of different combos of where I think it might be and got tons of compiler errors until I tried this which didn't have an error but acted strangely
The original grabber.cs looks like this:{Vector3 handPos = OVRInput.GetLocalControllerPosition(m_controller);Quaternion handRot = OVRInput.GetLocalControllerRotation(m_controller);GetComponent<Rigidbody>().MovePosition(m_anchorOffsetPosition + handPos + m_parentTransform.position);GetComponent<Rigidbody>().MoveRotation(handRot * m_anchorOffsetRotation * m_parentTransform.rotation);if (!m_useFixedJointForGrabbedObject && !m_parentHeldObject){MoveGrabbedObject();}m_lastPos = transform.position;m_lastRot = transform.rotation;}
What I gathered from your post was to try this:{Vector3 handPos = OVRInput.GetLocalControllerPosition(m_controller);Quaternion handRot = OVRInput.GetLocalControllerRotation(m_controller);GetComponent<Rigidbody>().MovePosition(m_anchorOffsetPosition + handPos + m_parentTransform.position);GetComponent<Rigidbody>().MoveRotation(handRot * m_anchorOffsetRotation * m_parentTransform.rotation);if (!m_useFixedJointForGrabbedObject && !m_parentHeldObject){MoveGrabbedObject();}Vector3 destPos = m_parentTransform.TransformPoint(m_anchorOffsetPosition + handPos);Quaternion destRot = handRot * m_anchorOffsetRotation * m_parentTransform.rotation;}Got some really strange results. When an object is grabbed they start spazzing out and flying sporadically in strange circles. Wish I wasn't so new at coding. - pjennessRising StarSorry missed this thread earlier..
try this:
https://forums.oculus.com/developer/discussion/comment/477400/#Comment_477400 - mfmfOculus StaffI updated the sample to fix the issue. (In the original post.)
- KevinLongtimeHeroic Explorer
mfmf said:
I updated the sample to fix the issue. (In the original post.)
@mfmf Works perfectly! Thank you!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 10 months ago