Jump to content
Sign in to follow this  
Alert23

setVectorDirAndUp help

Recommended Posts

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 by Alert23

Share this post


Link to post
Share on other sites

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]))
	];
}];

 

  • Like 2

Share this post


Link to post
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×