Can anyone please tell me what I'm doing wrong. I trying to make a program where a cone always points in the direction of another object. So that if the object leaves the cameras view you know which way to turn to find it.
autocam off
hide mouse
sync on
Rem Create Box
make object cube 1,75
scale object 1,100,100,100
Rem Create Cone
make object cone 2,5
scale object 2,25,25,100
xrotate object 2,90
fix object pivot 2
Rem Set Object Position And Movement Values
position object 1,5000,300,5000
position object 2,4500,300,5000
position camera 5000,300,4000
set camera range 1,3000
sp=12
sx=24
dismn=-500
dismx=500
way=1
suspend for key
Rem Main Loop
do
Rem Position Cube
move camera 300
position object 1,camera position x(),camera position y(),camera position z()
move camera -300
Rem Position Cone
move camera 20
position object 2,camera position x(),camera position y(),camera position z()
point object 2,oldx,oldy,oldz
move camera -20
Rem Print Values
oldx= object position x(1)
oldy= object position y(1)
oldz= object position z(1)
set cursor 1,1
print "Use arrow keys to Pitch and Turn Camera"
print "The Cone should always point at the Cube"
Print " "
print "Cube X Position=",oldx
print "Cube Y Position=",oldy
print "Cube Z Position=",oldz
Rem Control Free Flight Object (Keyboard)
if upkey()=1 then pitch camera down 5
if downkey()=1 then pitch camera up 5
if leftkey()=1 then turn camera left 5
if rightkey()=1 then turn camera right 5
Rem Control Free Flight Object (Joystick)
if joystick y() 100 then pitch camera up 1
if joystick fire x(2)=0 and joystick x() 100 then turn camera right 2
if joystick fire x(2)=1 and joystick x() 100 then roll camera right 2
Rem Movement Control
move object 1,10
sync
loop