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

Interactable Rigidbody state isn't managed correctly #2038

Closed
thestonefox opened this issue Jun 20, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@thestonefox
Copy link
Member

commented Jun 20, 2019

Environment

  • GitHub Master
  • master
  • 2019.1.5f1
  • Oculus
  • Oculus Integration

Steps to reproduce

Case 1:

  • Set an interactable to Follow Tracking: Follow Transform
  • Set the Interactable rigidbody to kinematic
  • grab the interactable
  • ungrab the interactable

Case 2:

  • Set an interactable to Follow Tracking: Follow Rigidbody
  • Set the Interactable rigidbody to kinematic
  • grab the interactable
  • ungrab the interactable

Case 3:

  • Set an interactable to Follow Tracking: Follow Rigidbody
  • Snap the interactable to a snap drop zone
  • grab the interactable

Expected behavior

Case 1: The interactable is still kinematic on release as it was before grabbing

Case 2: The interactable follows the interactor as it's being grabbed

Case 3: The interactable is unsnapped from the snap zone.

Current behavior

Case 1: The interactable goes back to being non-kinematic on release even though it's initial state was kinematic because the logic is always forcing it off.

Case 2: The interactable doesn't move because it needs to be non-kinematic for the rigidbody tracking to work but no kinematic state is changed.

Case 3: The interactable won't unsnap, because on snap the kinematic state is changed to be kinematic but the unsnap never resets the kinematic state to what it originally was.

@thestonefox thestonefox added the bug label Jun 20, 2019

@thestonefox

This comment has been minimized.

Copy link
Member Author

commented Jun 20, 2019

I think a potential good approach to this would be don't actually attempt to remember the kinematic state of the actual rigidbody but have a held state elsewhere that OnEnable copies the state of the rigidbody Kinematic state, but from then on, this state is used to set the Rigidbody Kinematic state.

This means that at any point someone can manually update this cached state to allow for a different state to be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.