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

ResetButton teleports if moved after Start() #114

Closed
JeffBail opened this issue Apr 17, 2019 · 1 comment
Closed

ResetButton teleports if moved after Start() #114

JeffBail opened this issue Apr 17, 2019 · 1 comment

Comments

@JeffBail
Copy link
Contributor

JeffBail commented Apr 17, 2019

I have a project in which a ResetButton is attached to an object that is moved once the project is running (and after Start() is called to cache the positions). When the button is pressed and then released the resetPoses cached in ResetButton.Start() are restored by OnColliderEventPressUp and cause the button to teleport to its original location in the scene.

I was able to reproduce the problem in the ColliderEvent.unity project that comes with VIU. Just start the example and then move the "ResetButton" object a bit. Then press and release the big red button and it will jump back to its original position.

I fixed the issue by simply doing what Start() does in OnColliderEventPressEnter and it seems to work fine. I've opened pull request #115.

JeffBail added a commit to JeffBail/ViveInputUtility-Unity that referenced this issue Apr 17, 2019
CachePositions() was created to allow the buttonObject and effectTargets position caches to be updated from OnColliderEventPressEnter. This allows the host of the ResetButton to be moved at runtime. If the cache is not updated the objects would end up getting moved to their start position in the scene after a button press. This is a fix for issue ViveSoftware#114.
@JeffBail
Copy link
Contributor Author

The fix worked for the buttonObject, but not for the effectTargets which get restored to their original location in the scene instead of their position at the time of the button press. I've submitted a new pull request - pull #117.

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

No branches or pull requests

1 participant