Which solution you choose (be it creating a PathFollow
when laying out the scene, or creating it at runtime) depends on the goal you want to achieve. Having written that, you can create a PathFollow
at runtime.
Create a Curve3D
for a Path
. Then add a PathFollow
as a child node of the Path
. Have whatever you want make use of the PathFollow
.