Is there a way to save the path i took?

I thought about maybe setting a spline while playing and then save that and give it to the NPC after i pressed a button but even if that would work i would’ve no idea how.