• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] How can I position the camera in front of the vehicle?
#1
Smile 
I'm trying to make a system where I need to position the camera in front of the vehicle so that it "points" to the vehicle without setting the coordinates in an array, having a "radius" using a GetVehicleModelInfo function.







I managed to do a function where I can get the front of the vehicle using some calculations. But I can't point the camera at the vehicle at the right angle.







PHP Code:
GetVehicleFront(vehicleid, &Float:x, &Float:y)

{

? ? new 
Float:aFloat:fSize[3];

? ? 
GetVehiclePos(vehicleidxya);

? ? 
GetVehicleZAngle(vehicleida);

? ? 
GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZEfSize[0], fSize[1], fSize[2]);



? ? 
= (/* radius using fSize? (about 7.5) */ floatsin(-adegrees));

? ? 
= (/* radius using fSize? (about 7.5) */ floatcos(-adegrees));

? ? return 
1;









btw, is this function correct??
  Reply


Messages In This Thread
How can I position the camera in front of the vehicle? - by Next - 2021-07-18, 11:55 PM

Forum Jump: