hi all
how can i get the camera tot stay behind the car, had tryed almost anything, accept the right thing
any help would be nice.
here is my code
` set up program
phy enable debug
phy start
autocam off
sync on
sync rate 90
color backdrop 0
make light 1
set directional light 1, -5, -5, 5
rem position camera -20, 20, -25
rem point camera 0, 10, 0
rem Variabler
rem Cars
rem ================================
rem Hastighed
EnginePower# = 200.0
` create ground
rem load image "road2.png", 1
rem make object box 1, 1000, 1, 1000
rem texture object 1, 1
load object "data\TestTrack.x",1
phy make rigid body static mesh 1
` load car
load object "data\beach.x", 2
load image "data\beachBu2.tga",2
load image "data\dbprocubemap.dds",3
texture object 2,2
set blend mapping on 2,1,3,2,16
rem position object 2, 15, 2, -25
rem rotate object 2,0,90,0
rem position object 2, 15, 2, -25
rotate limb 2,0,0,-90,0
` set up vehicle
phy create vehicle 2
phy add vehicle body 2, 2.2, 0.6, 0.75, 0.0, 0.6, 0.0
phy add vehicle wheel 2, 5, 1.5, 0.3, 1.1, 0.6, 0.2, 0, 0
phy add vehicle wheel 2, 7, 1.5, 0.3, -1.1, 0.6, 0.2, 0, 1
phy add vehicle wheel 2, 3, -1.5, 0.3, -1.1, 0.6, 0.2, 1, 0
phy add vehicle wheel 2, 9, -1.5, 0.3, 1.1, 0.6, 0.2, 1, 1
phy set vehicle max motor 2, EnginePower#
phy set vehicle steering delta 2, 0.1
phy set vehicle max steering angle 2, 0.4
phy set vehicle auto 2, 1
phy set vehicle suspension spring 2,100
phy build vehicle 2
` main loop
do
if upkey()=1
move object 2,EnginePower#
phy update
rem sync
endif
if downkey()=1
move object 2,-EnginePower#
phy update
endif
if leftkey()=1
yrotate object 2,wrapvalue(object angle y(2)-0.05)
phy update
endif
if rightkey()=1
yrotate object 2,wrapvalue(object angle y(2)+0.05)
phy update
endif
` follow car
set camera to follow object position x ( 2 ), object position y ( 2 ), object position z ( 2 ), 0, -11, 4, 1, 0
` update physics and screen
phy update
sync
loop
thx