Camera that follows

Blitz3D Forums/Blitz3D Beginners Area/Camera that follows

andycraig(Posted 2006) [#1]
Hi, im trying to make the camera follow my car, can anyone help. The car is called "car" and the camera is obviously camera.


GfK(Posted 2006) [#2]
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.


andycraig(Posted 2006) [#3]
thnx ill try it


andycraig(Posted 2006) [#4]
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???


GfK(Posted 2006) [#5]
maybe Camera and/or Car are not Global?


andycraig(Posted 2006) [#6]
so do i put global car?


Yeshu777(Posted 2006) [#7]
Try..

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


andycraig(Posted 2006) [#8]
ok im still trying it