class PlayVFXOnHitPositionEffector extends Effector
{
	var m_effectName : CName;
	var m_effectTag : CName;
	var m_applicationTarget : CName;

	protected export override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		m_applicationTarget = TDB.GetCName( record + T".applicationTarget" );
		m_effectName = TDB.GetCName( record + T".effectName" );
		m_effectTag = TDB.GetCName( record + T".effectTag" );
	}

	protected export override function ActionOn( owner : GameObject )
	{
		var effect : EffectInstance;
		var pos : Vector4;
		var target : weak< GameObject >;
		if( !( GetApplicationTarget( owner, m_applicationTarget, target ) ) )
		{
			return;
		}
		pos = ( ( GenericHitPrereqState )( GetPrereqState() ) ).GetHitEvent().hitPosition;
		effect = GameInstance.GetGameEffectSystem( owner.GetGame() ).CreateEffectStatic( m_effectName, m_effectTag, target );
		EffectData.SetVector( effect.GetSharedData(), GetAllBlackboardDefs().EffectSharedData.position, pos );
		EffectData.SetFloat( effect.GetSharedData(), GetAllBlackboardDefs().EffectSharedData.radius, 1.0 );
		effect.Run();
	}

	protected override function RepeatedAction( owner : GameObject )
	{
		ActionOn( owner );
	}

}

