sinny 18 Posted April 8, 2016 Hi all, Im going crazy here, im trying to attach a lamp [ Land_PortableLight_single_F ] to [i_MRAP_03_hmg_F]´s turret. Ive been using this: Lamp attachTo [Car,[0,0,0], "vez"]; Lamp setDir 180; Lamp setPos getPos vez; I have tried some variants but the light does not follow the turrets movement, it just points at the cars direction... Anyone know how to solve this? Many thanks! Share this post Link to post Share on other sites
killzone_kid 1326 Posted April 8, 2016 Try this in debug console MRAP = "I_MRAP_03_hmg_F" createVehicle position player; light = "Land_PortableLight_single_F" createVehicle [0,0,0]; light attachTo [MRAP, [0,0,0], "vez"]; addMissionEventHandler ["EachFrame", { light setVectorDirAndUp [ (MRAP selectionPosition "otochlaven") vectorFromTo (MRAP selectionPosition "pohon"), [0,0,1] ]; }]; setDate [4804,7,13,0,0]; player moveInGunner MRAP; player switchCamera "EXTERNAL"; 3 Share this post Link to post Share on other sites
sarogahtyp 1105 Posted April 9, 2016 Try this in debug console MRAP = "I_MRAP_03_hmg_F" createVehicle position player; light = "Land_PortableLight_single_F" createVehicle [0,0,0]; light attachTo [MRAP, [0,0,0], "vez"]; addMissionEventHandler ["EachFrame", { light setVectorDirAndUp [ (MRAP selectionPosition "otochlaven") vectorFromTo (MRAP selectionPosition "pohon"), [0,0,1] ]; }]; setDate [4804,7,13,0,0]; player moveInGunner MRAP; player switchCamera "EXTERNAL"; I tested ur code in debug console but the light is not moving with turrets movement. Share this post Link to post Share on other sites
killzone_kid 1326 Posted April 9, 2016 I tested ur code in debug console but the light is not moving with turrets movement. try on dev branch or replace eachframe eh with oneachframe Share this post Link to post Share on other sites
sarogahtyp 1105 Posted April 9, 2016 I took a Draw3D EH with ur code and it worked very well... MRAP = "I_MRAP_03_hmg_F" createVehicle position player; light = "Land_PortableLight_single_F" createVehicle [0,0,0]; light attachTo [MRAP, [0,0,0], "vez"]; addMissionEventHandler ["Draw3D", { light setVectorDirAndUp [ (MRAP selectionPosition "otochlaven") vectorFromTo (MRAP selectionPosition "pohon"), [0,0,1] ]; }]; setDate [4804,7,13,0,0]; player moveInGunner MRAP; player switchCamera "EXTERNAL"; Share this post Link to post Share on other sites
sinny 18 Posted April 9, 2016 Amazing! Thanks! :love: * Hmm it works just perfect on the I_MRAP_03_hmg_F But when i try the same setup on a B_APC_Tracked_01_CRV_F ,the light is out of place I dont think i understand the logic... Can someone please explain? Where C_11 is the bobcat and SearchLight2 is the light SearchLight2 attachTo [C_11, [0,0,0], "vez"]; addMissionEventHandler ["Draw3D", { SearchLight2 setVectorDirAndUp [ (C_11 selectionPosition "otochlaven") vectorFromTo (C_11 selectionPosition "pohon"), [0,0,1] ]; }]; Share this post Link to post Share on other sites
f2k sel 164 Posted April 16, 2016 Seems vehicles may be using different axis and turret selections , this seems to work a little better for the B_APC_Tracked_01_CRV_F but the light seems to lean back a bit. SearchLight2 attachTo [C_11, [0,0,0.3], "OsaVeze"]; addMissionEventHandler ["Draw3D", { SearchLight2 setVectorDirAndUp [ (C_11 selectionPosition "usti hlavne") vectorFromTo (C_11 selectionPosition "OsaHlavne"), [0,0,1] ]; }]; 1 Share this post Link to post Share on other sites
sinny 18 Posted April 16, 2016 Seems vehicles may be using different axis and turret selections , this seems to work a little better for the B_APC_Tracked_01_CRV_F but the light seems to lean back a bit. SearchLight2 attachTo [C_11, [0,0,0.3], "OsaVeze"]; addMissionEventHandler ["Draw3D", { SearchLight2 setVectorDirAndUp [ (C_11 selectionPosition "usti hlavne") vectorFromTo (C_11 selectionPosition "OsaHlavne"), [0,0,1] ]; }]; SUPER! Thanks man! And thanks all in this thread! :wub: Here is the awesome result: 1 Share this post Link to post Share on other sites