microsoft / MixedReality-UXTools-Unreal

UX tools and components for developing Mixed Reality applications in UE4.
https://microsoft.github.io/MixedReality-UXTools-Unreal/
MIT License
315 stars 87 forks source link

want to grab the whole uxt pinch slider actor #47

Open YiRonger opened 3 years ago

YiRonger commented 3 years ago

Hello, I want to grab the whole uxt pinch slider actor, but I don't want to activate the Thumb. What can I do?

lukastoenneMS commented 3 years ago

The following steps turn the slider in our examples into a grabbable actor:

  1. Make a basic actor
  2. Add a child actor with the UxtPinchSliderActor class.
  3. Add a UxtGenericManipulator component.
  4. Add a box collider component. Some important tweaks are needed here: 4.1 Adjust the scale to fit the visuals of the slider. Do not change the box extent values, for some reason this only affects the visual size but not the collision. 4.2 Move the box behind the thumb, so that the thumb activates first. If the thumb is enclosed inside the box you won't be able to reliable grab it. 4.3 Set the collision preset to "BlockAllDynamic", otherwise the Uxt hands will not be able to interact with the box.

At this point you can grab the box and manipulate the slider as a whole, or grab the thumb and change the slider as usual. grabslider1

You can even do both at the same time with one hand grabbing the slider and the other the thumb. That may not be desirable, so to switch between one or the other you can listen to the grab events on either of the two grabbable components and disable the other one to have exclusive grabbing. The API here isn't very consistent unfortunately, so i had to get a bit creative to disable interactions: image

Does this answer your question?

EVRTOP commented 2 years ago

I known thank you very much!!!