Home   Help Search Login Register  

Author Topic: Move an object with a camera (but the object must stay on the ground)  (Read 2366 times)

0 Members and 1 Guest are viewing this topic.

Offline Gonza

  • Members
  • *
Hello,

I want to create the same script than warfare construction
but whitout the interface

exemple :
http://www.youtube.com/v/ZkgmCj6ES1E?fs=1&hl=fr_FR

for the moment my script use a loop with a setpos but it is really jerky.
is there an other way ? (attachto ??)

Code: [Select]
stopcam = false;
_Offset = [0,15,0];

//create camera
VTS_Freecam = "camconstruct" camcreate [position player select 0, (position player select 1) - 6, 7];
VTS_Freecam camConstuctionSetParams [getpos player, 20000, 10000];
VTS_Freecam camSetTarget player; VTS_Freecam cameraeffect ["internal","back"];

//Spacekey to exit
_keydown_space = (finddisplay 46) displayaddeventhandler ["keydown", "
if ((_this select 1) == 57 ) then {
hint ""end"";
stopcam = true;
};
"];

//create the local uaz
_uaz = "UAZ_Unarmed_TK_CIV_EP1" createVehicleLocal getPos player ;

//setpos loop 20 M before the camera
while {!stopcam} do {
//sleep 0.1;
_uazpos = VTS_Freecam modelToWorld _Offset;
_uaz setPos [_uazpos select 0,_uazpos select 1,0];
};

//exit
deleteVehicle _uaz;
VTS_Freecam_target switchCamera "INTERNAL";
VTS_Freecam CameraEffect ["Terminate","Back"];
CamDestroy VTS_Freecam;
(finddisplay 46) displayRemoveEventHandler ["keydown",_keydown_space];
« Last Edit: 18 Aug 2010, 19:42:22 by Gonza »