How do i make a roll as a ball game

i have been watching a few videos with this kind of thing also games where you have to play as a rolling ball but im wondering how its done.

this video with the timestamp shows you what i mean

this video with the timestamp shows you what i mean

Playing Your Games - GnomeJam 2021 WINNERS - YouTube

if you can help. Much Appreciated

can’t really help you considering i have no idea how to script but you could learn from the code of this open sourced game i found: Ball Gameplay - Roblox