[AppleTV] How to scroll Scrollbar using the AppleTV Remote?

Hi,

Is it possible to scroll Scrollbar using the AppleTV Remote ? I have scrollable content and it would be great to be able to use the remote in order to scroll.

Thanks

Yeah this is easy enough to do on a panel the only thing to be aware of is if you leave it on automatic navigation the placement of the scrollbar is very important. In practice I usually find that scrollbars are big enough that I want to set the navigation to explicit and manually select where I’m going to navigate to on each of the directions. If you do this make sure that the items you want to scroll are set to none (if its a vertical scrollbar that would mean up and down should be set to none). The other directions (in the example left/right) set to which button or other UI object you want to select when you swipe that way. If you leave it to automatic it will navigate based on where in the scroll it currently is and since scrollbars are usually long that would mean if its near the top it will want to navigate towards high buttons but if its near the bottom it will navigate towards low buttons and this isn’t always desirable. You can also set it to horizontal or vertical if automatic behavior is ok but it’s getting confused on which way it should scroll and which way it should navigate to other UI elements.

Hope that helps.

Hi,

Ok, but how to make the scrollbar having the focus and the remote “scrolls” the scrollbar ?

Thanks

Generally speaking you just add a UI scrollbar to the panel which has your other UI elements on it (buttons, checkboxes, etc). By default the swipe of the touchpad will navigate around your UI so you just swipe over to your scrollbar and it’s selected and then the swipes in the direction of the scrollbar (can be either horizontal or vertical) will scroll the scrollbar.

If you want to do it programatically because your doing something fancy just use EventSystem.SetSelectedGameObject.

Ok, I tried EventSystem.SetSelectedGameObject but id did not work - I will try again. Just to be sure, I have to pass the GameObject into which the Scrollbar component is - is that right ? I ask, because first time I thought pass the Scrollbar component itself but it’s not a valid argument.

Thanks

Correct it wants a gameobject not any of the components.

Hi,

Ok, EventSystem.SetSelectedGameObject works with the GO that hold the Scrollbar component. But the scroll is definitively not smooth at all whereas with the mouse-scroll or by dragging the scrollRect it’s smooth. I have to touch and hold the remote edges to have the scroll running faster and a bit smoother - just moving slowly or not the finger on the touch surface barely make the scrollbar scrolls - it’s like the scrollbar has steps but it’s not the case.

Does someone noticed the same things ? How to have smooth scrolling using the AppleTV touch surface ?

Thanks

The default Apple TV input module that Unity provides treats the touchpad like both a dpad (when you talk about hitting the edges) and the touch surface (the swipe based navigation). As far as the input module is concerned both are behaving like a controller and really are step based (when the swipes reach far enough it fires off a direction type event).

It sounds like you want something more like a touchscreen with dynamic scrolling when you drag on the surface. I’d agree that this is probably a bit nicer and I can play around with this tonight and probably add it to easy input helper if all goes well.

I can’t speak for Unity but I have a feeling that this probably would be a very low priority and might be awhile for them to implement something similar in the one they provide.

Hi,

Ok, I understand. If your plugin can handle that kind of behaviour you’ll get a new buyer :slight_smile:

I played with this tonight and I think it’s doable but it’s going to take me a couple of days to come up with a best approach, because the traditional approach that mouse/touchscreen uses for this is not possible (raycasts off the cursor or touch position). On the Apple TV there is no cursor to raycast off of so I will have to do something else.

I believe I will go with a delta approach just with much smaller chunks so that it appears to be fluid movement and not step based. There are a few things that I’m undecided on still but perhaps I can get this update on the store in a week or two we’ll see how it goes.

Ok, I will look at your solution when is done !
Thanks !

I actually got some time to implement this today and this will be in the next update (probably live on the store sometime next week). It is step based but much smaller chunks (default is 100 steps but you can tweak in inspector as you wish). 100 felt good when testing the scene for scrolling smoothly. It’s important to note while the scrolling is smooth, unlike the default Unity one, it is still a bit different than on phone which has the inertial/momentum scrolling, like when you scroll real fast and it keeps on moving. I thought about adding logic for this but decided against it since the siri remote touchpad is so small, at least to me it’s not enough real estate to really designate when you want it to have inertia and when not to. But the scrolling is smooth and configurable.

This applies to all the Unity Gui scroll widgets (Scrollbar, Slider, and Scroll View). The only limitation is that for scroll views not that it’s common in games but you can’t have both a horizontal and a vertical scroll at the same time. The reason for this is if all 4 swipe directions are taken up by scrolling then there is no way to scroll back to any other UI elements like buttons, checkboxes, etc. You can have one or the other just not both.

The asset’s input module is smart enough to know when it’s the Siri Remote as well, if you are using a mFi controller instead it will go back to the step based approach to scrolling and only do the smooth scrolling when you have the Siri Remote.

I’ll post back again when this is live, but if I had to guess it should pass review sometime next week.

V1.4 that now includes this smooth scrolling on all the scrollbars, sliders, and scrollviews just went live on the assetstore.

That’s great ! thanks !