Side to side panning

Questions about producing? Ask them here.
im searchings ways to make possible make the sound of an instrument go from side to side automatically, is there a way to make something like that? thx
He makes things a bit harder then needed, but I think you get the idea.

Drag the pan button into an automation track. Then draw a graph on how you want to pan.

https://www.youtube.com/watch?v=HvXlHjsbCY4
They say automatically. You can connect it to an LFO.
Automation.