Here's an old snippet that 'may' help. Move around with cursors.
sync on : sync rate 60 : autocam off
make object cube 1,10
make object cube 2,10
make object box 3,2,2,50 : color object 3,rgb(255,0,0) : offset limb 3,0,0,0,25
make object box 4,2,2,50 : color object 4,rgb(0,255,0) : offset limb 4,0,0,0,25
make object box 5,2,2,50 : color object 5,rgb(0,0,255) : offset limb 5,0,0,0,25
position object 1,20,0,30
position object 2,30,0,45
position camera 0,200,0
pitch camera down 90
do
if upkey() then move object 2,1
if downkey() then move object 2,-1
if leftkey() then yrotate object 2,wrapvalue(object angle y(2)-1)
if rightkey() then yrotate object 2,wrapvalue(object angle y(2)+1)
ang#=atanfull(object position x(1)-object position x(2),object position z(1)-object position z(2))
position object 3,object position x(2),object position y(2),object position z(2)
yrotate object 3,ang#
position object 4,object position x(2),object position y(2),object position z(2)
position object 5,object position x(2),object position y(2),object position z(2)
yrotate object 5,object angle y(2)
ang2#=-wrapvalue(object angle y(2)-ang#)
if ang2# < -180 then ang2#=360.0+ang2#
set cursor 0,0
print "Green - Red: ";ang#
print "Blue - Red: ";ang2#
if ang2# >= 0
print "You need to rotate right by ";ang2#;" degrees"
else
print "You need to rotate left by ";-ang2#;" degrees"
endif
sync
loop
Boo!