I'm making a basic space sim and I want to have a sort of 3rd person view with the ship in front of you. I'm using the 'Set Camera to Follow' command to make it follow the plane but I don't think I quite get it. This is the code:
If pXTurn = 1 Then Turn Object Left 1, pTurnSpeed#
If pXTurn = 2 Then Turn Object Right 1, pTurnSpeed#
If PYTurn = 1 Then Pitch Object Down 1, pTurnSpeed#
If PYTurn = 2 Then Pitch Object Up 1, pTurnSpeed#
Move Object 1, (0 - pSpeed#)
cDist# = -300
cHeight# = pY# + 150
cSmooth# = 20
pX# = Object Position X(1)
pY# = Object Position Y(1)
pZ# = Object Position Z(1)
pA# = Object Angle X(1)
Set Camera To Follow pX#, pY#, pZ#, pA#, cDist#, cHeight#, cSmooth#, 1
I don't think I understand how the camera to follow thing works properly (or maybe I have the wrong use for it), but after I rotate the ship left and have an angle greater then around 90 degrees the camera slowly stops following it and eventually I can end up looking head on with the ship model. How do I make it follow the whole way around? And also follow the pitch of the ship as well, I'd like the camera to move down as I pitch up or up as I pitch down, any ideas?
"Computers are useless they can only give you answers."