Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Toolkit sliders problems

I am starting to use the mixed reality toolkit trying several examples. I want to ask problems I am having sliders (as in https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/master/Assets/HoloToolkit-Examples/UX/Readme/README_InteractiveButtonComponents.md

The first problem: When I put a slider in my solution and set (with the Inspector) its Min Slider Value and Max Slider Value (to for example 0.1 and 1) and I run the program I get a slider that can go from 0 to 0.9!!!
I wonder why this is happening?

The second problem: Sometimes when trying sliders they get drawn in a incorrect orientation as it had fall down. Particularly in the example provided by the toolkit there are 4 types of slider: Billboarder, Billboarded centered, Control Alligned and Camera Aligned. (I don't quite catch the differences) The problem occurs in the first two (billboarded)
This obviously does not look good

Any help appreciated

Answers

  • ago16bago16b
    edited July 2018

    Hey @hitoruna

    I am having the same issue as you stated in your first question. Like I want the values to go from 0.1 to 25, but it makes it go from 0 to 24.99. This is bad for me because I cannot ever have a value of zero for math reasons.

    My work around was adding the following to SliderGestureControls.cs:

            /// <summary>
            /// The value of the slider
            /// </summary>
            public float SliderValue
            {
                private set
                {
                    if (mSliderValue != value)
                    {
                        mSliderValue = value;
                        OnUpdateEvent.Invoke(mSliderValue);
                    }
                }
                get
                {
                    if (mSliderValue == 0.0f)     // What I added
                        mSliderValue = 0.01f;
    
                    return mSliderValue;
                }
            }
    

    This is obviously a terrible fix but if you only have one slider using this script it may work. Especially if you add else if statements for the upper bound.

    I hope someone sees this problem and can explain to us what to do, because looking through the code I was unable to pinpoint the culprit.

  • I read that this problem is a bug, that is already fixed in the development version. Therefore it will be incorporated in the next release

Sign In or Register to comment.