ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
357 stars 82 forks source link

ResetButton teleports if moved after Start() #114

Closed JeffBail closed 5 years ago

JeffBail commented 5 years ago

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 commented 5 years ago

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.