
; Mark active unit with green particle and health bar

	
	_dir = 0
	_pos = 3
	_x = 0
	_y = 0
	_z = 3

	#Loop
	? !alive SELECTED : SELECTED=camtarget
	@SELECTED != camtarget  &&  !(SELECTED in BUILT)
	_unit = SELECTED
	
	if (_dir < 360) then {_dir=_dir+10} else {_dir=0}
	
	_x1 = 1 * (sin (_dir))
	_y1 = 1 * (cos (_dir))
	_x2 = sin(velocity SELECTED select 0) * 2
	_y2 = cos(velocity SELECTED select 1) * 2
	
	? side _unit == MYSIDEVAR : Drop ["cl_water","","Billboard",1,0.2,[_x1,_y1,0],[_x2,_y2,0],0,2,1.1,0,[1,0,0],[[0,0.7725,0.2510,1]],[0,1,0],1,0.8,"","",_unit]
	

		_health = (1 - getDammage _unit) * 100
		_health = _health - (_health mod 1)
		if  (_health mod 10 >= 5) then {_health=_health - (_health mod 10) + 10} else {_health=_health - (_health mod 10)}
		_health = _health / 10
		? _health == 0 : _health=1
		;player globalchat format ["%1",getDammage _unit]
		
		_model = format ["\Dune\health\%1",_health]
	
	
	
	
_AnimationName = ""
_Type = "Billboard"
_TimerPeriod = 120
_LifeTime = 0.037
_Position = [_x,_y,_z]
_MoveVelocity = [0,0,0]
_RotationVelocity = 0
_Weight = 80
_Volume = 0
_Rubbing = 0

_Size = [1.5]
_Color = [[0.5,0.5,0, 1]]
_AnimationPhase = [0]

_RandomDirectionPeriod = 0
_RandomDirectionIntensity = 0
_OnTimer = ""
_BeforeDestroy = ""
_Object = _unit


drop [_model, _AnimationName, _Type, _TimerPeriod, _LifeTime, _Position, _MoveVelocity, _RotationVelocity, _Weight, _Volume, _Rubbing, _Size, _Color, _AnimationPhase, _RandomDirectionPeriod, _RandomDirectionIntensity, _OnTimer, _BeforeDestroy, _Object]
		


	~0.01
	goto "Loop"
	
	