Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene 021 - Unable to Swap Object Between Hands #50

Closed
xEvoGx opened this issue May 12, 2016 · 9 comments
Closed

Scene 021 - Unable to Swap Object Between Hands #50

xEvoGx opened this issue May 12, 2016 · 9 comments
Labels

Comments

@xEvoGx
Copy link

xEvoGx commented May 12, 2016

021_Controller_GrabbingObjectsWithJoints

This could and probably does pertain to any other given scene supporting object grabbing. When you hold an object in one hand, then (while still maintaining the hold) you grab the same object with the other hand, then subsequently let go of the previous hand, depending on how far apart you moved either hand while both were grabbing the object, the object will 'swing' off of the remaining grabbing hand as if on an invisible string (phew that was some sentence!).

Think of the magic trick where a card is suspended between the magicians hands by very thin, invisible wire.

Cheers

-Steven

@thestonefox
Copy link
Member

Yeah I can see why that is doing that.

The new code checks to see if the object has a joint already on it, then attaches a spring joint instead of a fixed joint.

I'd probably need to check to see if the object is being held already before allowing another controller to grab it. Then the spring (or any other joint wouldn't be added).

@xEvoGx
Copy link
Author

xEvoGx commented May 12, 2016

This may or not be related, but I loathe to overwhelm you with posted Issues haha...

...but the physics begins to falter and fail when you try to push a held object into another rigid body (say the table the objects were sitting on). I understand Unity physics can be janky, but perhaps there should be a dampening and/or limiter fail safe of sorts that auto-disconnects the held object from the controller after X, and harmlessly drops to the floor rather than furiously fight to maintain it's position in the hand.

(If this should be it's own issue we can separate it out)

Thanks Stonefox! (Theston?)

-Steven

@thestonefox
Copy link
Member

I think that is to do with the Unity physics solver. A higher number helps it work out better collision resolution.

However, it may be a nice idea as you suggested to just break the grip if it goes crazy.

You see the same crazy collision resolution issues in things like job simulator and the lab.

@xEvoGx
Copy link
Author

xEvoGx commented May 12, 2016

Exactly and yea I know it's an all-purpose issue with engine physics, which is why I'm amazed that more implementations don't simply mitigate it by relaxing the pull of the body to the hand, or altogether disconnect it.

If an end-user fails to understand that a mug does not naturally pass through walls, the floor or you monitor and it falls out of their hand, that's on them methinks!

@thestonefox
Copy link
Member

I think it's a fair trade off to say if you're trying to do something stupid with physics then just drop the object.

@xEvoGx
Copy link
Author

xEvoGx commented May 12, 2016

Exactly!

@thestonefox
Copy link
Member

I think this can be solved by just adding a break force to the joint created on the controller.

If an object starts going crazy in the physics its because a large force is being applied and the physics engine doesn't know what to do.

So a force on the joint will cause a natural break.

@thestonefox
Copy link
Member

Magic trick effect removed.

No more magic allowed in VR.

Fixed with commit f8e1dac

@xEvoGx
Copy link
Author

xEvoGx commented May 13, 2016

Wonderful I try it out asap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants