I'm trying to write a code that make the camera follow the player as in 3rd person games.
the problem is that i don't know how to make the camera turn around with the player. i know how to make the camera follow the x,y,z positions of the playr. here is my code:
sync on : sync rate 60 : hide mouse
for i = 1 to 10
make object cube i,100
position object i,rnd(2000),0,rnd(2000)
next i
make object sphere 11,50
do
if upkey()=1 then move object 11,5
if leftkey()=1 then yrotate object 11,object angle y(11)-1
if rightkey()=1 then yrotate object 11,object angle y(11)+1
position camera object position x(11),50,object position z(11)-200
sync
loop
any ideas?