Alert23 215 Posted March 9, 2023 (edited) Hi, im trying to make a reflectorCone Look at screen center but I have struggles with the "setVectorDirAndUp" command, can some please help me solve this issue? lightCone = "Reflector_Cone_01_narrow_white_F" createVehicle [0,0,0]; LightCone attachTo [player, [0,0,0],"head"];//i dont want it to follow bone rotation as it is not accurate if player is in prone or crouch waitUntil {!isNull (findDisplay 46)}; (findDisplay 46) displayAddEventHandler ["MouseMoving", { lightcone setVectorDirAndUp [[0,0,0], [0,0,0]];//i dont know what to type here }]; Edited March 9, 2023 by Alert23 Share this post Link to post Share on other sites
EO 11277 Posted March 9, 2023 Might help...http://killzonekid.com/arma-scripting-tutorials-attachto-and-setvectordirandup/ 1 Share this post Link to post Share on other sites
Alert23 215 Posted March 9, 2023 8 hours ago, EO said: Might help...http://killzonekid.com/arma-scripting-tutorials-attachto-and-setvectordirandup/ Thanks for the link, but I'm very weak at math, I hope someone with better understanding than me can help Share this post Link to post Share on other sites
Alert23 215 Posted March 10, 2023 Okay, a amazing guy "EL_D148L0" from Arma Discord helped me with this issue and here is the solution for anyone interested: lightCone = "Reflector_Cone_01_narrow_white_F" createVehicle [0,0,0]; lightCone attachTo [player, [0,0,0], "head", false]; waitUntil {!isNull (findDisplay 46)}; (findDisplay 46) displayAddEventHandler ["MouseMoving", { lightCone setVectorDirAndUp [ player vectorworldtomodel ((positionCameraToWorld [0,0,1]) vectordiff (positionCameraToWorld [0,0,0])), player vectorworldtomodel ((positionCameraToWorld [0,1,0]) vectordiff (positionCameraToWorld [0,0,0])) ]; }]; 2 Share this post Link to post Share on other sites
Harzach 2517 Posted March 11, 2023 I was going to take this up when I was back at my PC tomorrow, but glad to see you've got it sorted. @Leopard20 explains the "why" of setting the vector to model coordinates here: Share this post Link to post Share on other sites