Is there anyway to autoscroll with a script in a RichTextLabel?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Trenico

Hi, I have a RichTextLabel with a lot of information and I can scroll through it, but I would like it to autoscroll with a script, like for instance, the credits of a movie, I would like to recreate the same effect with the RichTextLabel, but I can’t find information anywhere.

I appreciate any help, thanks!

If you want that for credits, I would suggest making a video and using a VideoPlayer node. If you need to change the text so you can’t use the video, I don’t know how you could do that or even if this is possible. It might be, but I really don’t have an idea on how you could do that. Good luck!

fpicoral | 2019-01-25 21:41

:bust_in_silhouette: Reply From: 44ron

Hey, I know this is an old question, but I figured out how to do it!
So, basically, the scrollbar of RichTextLabel is some kind of progressbar.
First we need to get this kind of progressbar:

$RichTextLabel.get_child(0)

Then all we have to do is change its value in the process function.

func _process(delta):
    $RichTextLabel.get_child(0).value += 1

Hope it’ll help, have a nice day :slight_smile:

Dude, thank you. It worked. You saved me a lot of time.

Also you can just put:

$RichTextLabel.set_scroll_follow(true)

in _ready()

novicer | 2023-04-01 11:00