Camera that follows

Blitz3D Forums/Blitz3D Beginners Area/Camera that follows

Hi, im trying to make the camera follow my car, can anyone help. The car is called "car" and the camera is obviously camera.

In its crudest form:
EntityParent Camera,Car ;parent camera to car
RotateEntity Camera,EntityPitch(car),EntityYaw(car),EntityRoll(car),True ;point camera same direction as car
MoveEntity Camera,0,10,-20 ;adjust these to get the cam where you want it to be
PointEntity Camera,Car ;Point the camera at the car

This code probably won't do exactly what you want straight off, but it should get you going the right direction.

thnx ill try it

hey apparently on this line:

RotateEntity camera,EntityPitch (car),EntityYaw (car),EntityRoll (car),True ;point camera same direction as car

it says that entity does not exist, huh???

maybe Camera and/or Car are not Global?

so do i put global car?

Try..

http://www.blitzbasic.com/codearcs/codearcs.php?code=798

ok im still trying it