attachto would be more or less the same as relpos to be honest , with the added option of using a selection position to define where the cam is attached.
without trying in game it would be something like
//followplane.sqf
_plane = _this select 0;
keepfollowing = true;
_cam = "camera" camcreate [0, 0, 0];
_cam cameraeffect ["internal", "back"];
//_relpos = [0, -5, 5];
//_cam camSetRelPos _relpos;
_cam attachto [_plane,[0, 0,0]];
// you could find a selection pos too i guess if it works [_plane,[0, 0,0],"zeleny pozicni"]
_cam camSetTarget _plane;
_cam camSetFov 1;
_cam camCommit 0;
sleep 12;
_cam cameraeffect ["terminate", "back"];
camDestroy _cam
i have left out your while loop but you can put it back in , i am not sure what you would want in there because your relpos would be redundant using attachto. maybe just
while {keepfollowing} do
{
Sleep 0.01;
};
will do for now.
try that and especially the selection pos and let me know, i might find a need for it myself if it works.
DB