Yeah, that's basically the jist of it although I wouldn't create and delete the object everytime the routine's called (could be every program cycle), I'd just create it when the program initializes or use the
Object Exist command within the function like so:
Function Objectpointing?(object,x,y,z,testob)
xa = object angle x()
ya = object angle y()
za = object angle z()
If Object Exist(testob) = 0 Then Make object cube testob,1
Position object testob,x,y,z
Hide object testob
Point object object, testob
xb = object angle x()
yb = object angle y()
zb = object angle z()
If xa = xb and ya = yb and za = zb Then yes = 1
Rotate object object,x,y,z
Endfunction yes
"Computers are useless they can only give you answers."