![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | John97 |
I’d like for the scroll bar to move left when left is pressed and right when right is pressed. How can I make that happen?
![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | John97 |
I’d like for the scroll bar to move left when left is pressed and right when right is pressed. How can I make that happen?
![]() |
Reply From: | John97 |
This works, but may not be the most efficient.
func _process(_delta):
if self.visible == true:
if Input.is_action_pressed("ui_right") == true:
*path to scrollbox container*.set_h_scroll(*path to scrollbox container.get_h_scroll() + 20)
if Input.is_action_pressed("ui_left") == true:
*path to scrollbox container*.set_h_scroll(*path to scrollbox container.get_h_scroll() - 20)