Here's an example snippet to demonstrate the principle...
Sync On
CLS 0
Hide Mouse
Make Matrix 1,500,500,20,20
Randomize matrix 1,10
Make Object Cone 1,3
Color Object 1,RGB(255,0,0)
XRotate Object 1,90
Fix Object Pivot 1
Position Object 1,250,Get Ground Height(1,250,250)+1,250
Make Object Cone 2,1
Color Object 2,RGB(0,255,0)
XRotate Object 2,90
Fix Object Pivot 2
Position Object 2,250,Get Ground Height(1,250,250)+1,250
Camdist = 20
ReqCamheight = 10
Camsmooth=20
ColFlag=0
CompanionDist# = 3.0: Rem Distance from main object
CompanionAng# = 90.0: Rem Angle companion positioned to main object (Eg: 90 = on right 180 = behind)
CompanionHeight# = 3.0: Rem Height of companion in relation to main object
Do
MMx = mousemovex()
Y# = WrapValue(Object Angle Y(1) + MMx)
Yrotate Object 1,Y#
Move Object 1,.4
ObjHeight#=Get Ground Height(1,Object Position X(1),Object Position Z(1))+1
Position Object 1,Object Position X(1),ObjHeight#,Object Position Z(1)
Position Object 2,Object Position X(1),Object Position Y(1)+CompanionHeight#,Object Position Z(1)
YRotate Object 2,WrapValue(Object Angle Y(1)+CompanionAng#)
Move Object 2,CompanionDist#
YRotate Object 2,Object Angle Y(1)
Camheight=Get Ground Height(1,Camera Position X(),Camera Position Z())+ReqCamheight: Rem <<< Track Terrain Height
SET CAMERA TO FOLLOW Object Position X(1),Object Position Y(1),Object Position Z(1), WrapValue(Object Angle Y(1)+0), Camdist, Camheight, Camsmooth, ColFlag
Sync
Loop
[Edit] For some reason, the first few lines of the code snippet didn't paste, so the program didn't run. Now added the missing lines! Sorry about that!
TDK_Man