We discovered the bug while our team developped a custom way of interacting with sliders with the finger. Basically, the when the finger is close to the slider, the finger position is resolved on the slider’s axis and used to move adequately the slider. Slider is affected only through the modification of the slider.value property.
snip of code :
float point = Vector3.Dot(transform.right.normalized, fingerTipPosition - colliderStart);
float percentAlongSlider = (point) / colliderWorldWidth;
float result = sliderWidth * percentAlongSlider + sliderStartValue;
m_UnitySlider.value = result;
But when built for the VisionOS platform and tested in the headset (I havent tested in the simulator), it behaves as such :
Note that the UGUI slider with native interaction system also has that lag (taken from PolySpatial samples scene UGUI):
Expected behavior : The left side of the slider should stay still.
This does not happen when we reproduce the situation in the Editor at runtime.
Also, I observed the same issue on a slider used as loading bar for our app. The slider component is inactive and I simply change the value of the RectTransform delta size like this :
LeanTween.size(m_SliderFillArea, m_SliderParent.sizeDelta, wLoadTime).setEaseOutQuad();
// which ultimately just changes the size delta of the rect transform
public LTDescr setCanvasSizeDelta(){
this.type = TweenAction.CANVAS_SIZEDELTA;
this.initInternal = ()=>{ this.from = this.rectTransform.sizeDelta; };
this.easeInternal = ()=>{ this.rectTransform.sizeDelta = easeMethod(); };
return this;
}
Which makes me think that the issue is not related to sliders specifically, but related to the rendering (refreshrate?) of the RectTransforms and their anchor points.
Other things to consider that might affect the behavior :
- General performance
- Lossy scale on slider
I would appreciate some feedback in order so see if I can do something to fix this lag on my end.
Thank you!