VRPhysicsHands icon indicating copy to clipboard operation
VRPhysicsHands copied to clipboard

Glitch With Physics Hands

Open BezbroGames opened this issue 4 years ago • 17 comments

Hello oxters168, I tried out the hands in my unity project but they keep floating away/sometimes slowly moving towards my IRL hands but rotating + floating in weird ways. The hand anchors are set correctly and everything is imported and in the right place. Do you know how to fix this?

BezbroGames avatar Apr 29 '20 19:04 BezbroGames

Is this happening after modifications, or is this from vanilla cloning? From what you're describing, it sounds like the headset is losing tracking often, so you might want to check that your play area is well lit and that the headset cameras are clean. If that is not the issue then can you record this happening so I can try and understand more.

oxters168 avatar Apr 29 '20 20:04 oxters168

This is from vanilla cloning. It's not tracking as I just successfully tested a hand tracking game under the same conditions. I will record a video.

BezbroGames avatar Apr 29 '20 20:04 BezbroGames

https://imgur.com/a/QB7On3G It may look like the hands are in my real hand's positions but they're not. It seems as if the hands are very slowly attaching themselves to my IRL hands, rather than quickly.

BezbroGames avatar Apr 29 '20 20:04 BezbroGames

I just had a look at your video. The current way I have the hands programmed causes them to sometimes slowly move back into place (they use physics to move into place, so if you have changed physics settings it can affect them). But once they're in place, they should keep up fine. When they lose tracking they might slightly fly away making them have to slowly come back again when tracking is back. I'm still working on this as I also don't like it either, but this is the current state of these hands. When the hands do catch up to your real hands, are they off at all, like rotated incorrectly or something? There's a chance that might happen if you disable then re-enable them. There isn't much I can do now to fix either issue, but when I get a chance to work on them, I'll see what I can do about it. If you think the issue is something else, let me know.

oxters168 avatar Apr 29 '20 22:04 oxters168

Also, I forgot to mention something. First off, what you're working on looks really cool! Secondly, I've never tested the hand tracking through the link cable in the Unity editor, so maybe that is something that might be causing the issue? I doubt it, but thought I'd mention it anyways.

oxters168 avatar Apr 29 '20 22:04 oxters168

I just thought of something else a bit more obscure that might be causing the issue. The hands are each on a different layer that I had created, don't remember which indices though. So you might be already using those layers for something else that might be affecting the hands in some way? A bit of a stretch, but could be possible.

oxters168 avatar Apr 29 '20 22:04 oxters168

Was the layer called "Hand"? cause it did auto-set Hand as it's layer...

Might be something else though.

BezbroGames avatar Apr 29 '20 23:04 BezbroGames

Ok, it wasn't the layers. I set to default on both the hands and it still had the same results.

BezbroGames avatar Apr 30 '20 03:04 BezbroGames

I'm getting an error when I play that says:

"MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object."

It could be an error with transform(s) in the script? I don't know.

BezbroGames avatar Apr 30 '20 03:04 BezbroGames

Yeah, the layers are HandL and HandR. I pushed a change that should fix the error. Though I don't think it's related to your initial issue. I have an idea of something that might fix the issue though. Find the ProjectSettings.asset file in the Library folder. Then change it's extension or move it out of that folder to back it up. Then open Unity again and see if anything has changed

oxters168 avatar Apr 30 '20 11:04 oxters168

I just pushed another change that snaps the hands into place if they're too far, rather than slowly coming back in. They still drift off when losing tracking, but they snap back in place when tracking is back.

oxters168 avatar Apr 30 '20 11:04 oxters168

Ok I tested it out and it's working okay, but I've found that the biggest issue is rotating your hands in any way. It causes the physics hands to become disfigured, even when your tracking is fine.

BezbroGames avatar Apr 30 '20 23:04 BezbroGames

I just pushed another change similar to the previous one but this time for rotational offset. And I adjusted the values to be reasonable so that the hands don't just phase through everything. I'm not sure if I'm fixing your issue though because I'm still unsure if your issue is related to this or not. If possible, it would help if I could test directly in your project or a stripped down version with the issue. Oh and you know, I just realized I didn't ask what version of Unity you're using and what version of the Oculus integration asset you have

oxters168 avatar May 01 '20 13:05 oxters168

Both recently pushed changes didn't really fix the problem, they just limited the extent of it. Big things I noticed were the thumb keeps bending downwards at the base, and without the position + rotation snap (which makes it really choppy at a small range) the hands are very slow to return to the hand anchors. I'm not quite sure how everything works but couldn't you just parent the hands to the anchors or in someway fix it to the anchors? Btw I'm using unity 2019.1.0f2 and the latest version of the Oculus SDK. Thanks for all the help!

BezbroGames avatar May 01 '20 22:05 BezbroGames

This project was created with Unity 2019.2.19f1 and while that is different from your version, I don't expect it should cause an issue. It would be a good idea to make a copy of your project and update it just to make sure it isn't. And if it still isn't the issue, would you mind sending me your project or at least a stripped down version of it with just the issue so I can try to directly work with it. I can't seem to replicate the issue so it's quite difficult trying to fix it without having direct results.

oxters168 avatar May 02 '20 09:05 oxters168

I updated my unity version and the hands work fine, except the issue with the thumb weirdly bending down is still there. I've also found that no matter how large I set the max pos offset the hand still clips through objects. The physics are great though keep it up!

BezbroGames avatar May 02 '20 21:05 BezbroGames

I pushed another update that allows you to turn off the max offset stuff. But even when they're off, there is some degree of phasing through objects based on how fast the hands are going or other physics stuff. You can probably get better results by messing with the physics settings of Unity. I don't know why the thumb is giving you issues though.

oxters168 avatar May 03 '20 00:05 oxters168