Announcement

Collapse
No announcement yet.

PlayHitEffects Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PlayHitEffects Problem

    This works fine on my enemy pawns, but when my player pawn is hurt no particle effects spawn. I'm not sure why. I've even changed the Dmgtype received from my enemies to be the same as the one I'm inflicting on them, but it still doesn't spawn a particle effect when my pawn is hurt.

    In my pawn's PlayTakeHitEffects() I have this:
    Code:
    simulated function PlayTakeHitEffects()
    {
    	local class<UTDamageType> UTDamage;
    	local vector BloodMomentum;
    	local UTEmit_HitEffect HitEffect;
    	local ParticleSystem BloodTemplate;
    
    UTDamage = class<UTDamageType>(LastTakeHitInfo.DamageType);
    
    if ( UTDamage.default.bCausesBlood)
    {
    BloodTemplate = class'UTEmitter'.static.GetTemplateForDistance(GetFamilyInfo().default.BloodEffects, LastTakeHitInfo.HitLocation, WorldInfo);
    	if (BloodTemplate != None)
    	{
    	BloodMomentum = Normal(-1.0 * LastTakeHitInfo.Momentum) + (0.5 * VRand());
    	HitEffect = Spawn(GetFamilyInfo().default.BloodEmitterClass, self,, LastTakeHitInfo.HitLocation, rotator(BloodMomentum));
    	HitEffect.SetTemplate(BloodTemplate, true);
    	HitEffect.AttachTo(self, LastTakeHitInfo.HitBone);
    
    		DrawDebugSphere(LastTakeHitInfo.HitLocation,10,10,0,0,255,true); 
    		//DebugMessagePlayer("HitEffect?" @ HitEffect);
    		//DebugMessagePlayer("BloodTemplate?" @ BloodTemplate);
    		//DebugMessagePlayer("BloodMomentum?" @ BloodMomentum);
    		//DebugMessagePlayer("momentum?" @ LastTakeHitInfo.Momentum);
    		//DebugMessagePlayer("HitLocation?" @ LastTakeHitInfo.HitLocation);
    		//DebugMessagePlayer("HitBone" @ LastTakeHitInfo.HitBone);
    		//DebugMessagePlayer("Damage type?" @ UTDamage);
    						
    	}
    }
    All my debug messages look correct. There is nothing that equals none. I've looked through my default properties and I can't see anything that would prevent particle effects being spawned.

    Any help please?
    Thanks

    #2
    Maybe it's something with the visibilty of the particle , perhaps you could use a different particle no ?

    Comment


      #3
      Well i checked my Family classes that extend off UTFamilyInfo. Both my Pawn and the enemy pawns are using the same set of particles:
      Code:
       BloodEffects[0]=(Template=ParticleSystem'T_FX.Effects.P_FX_Bloodhit_Corrupt_Far',MinDistance=750.0)
      	BloodEffects[1]=(Template=ParticleSystem'T_FX.Effects.P_FX_Bloodhit_Corrupt_Mid',MinDistance=350.0)
      	BloodEffects[2]=(Template=ParticleSystem'T_FX.Effects.P_FX_Bloodhit_Corrupt_Near',MinDistance=0.0)
      So there can't be anything wrong with them...

      Comment


        #4
        Try spawning the emitter without the owner "self"... what happens then? I could think of bOwnerNoSee or something like that interfering the visiblity.

        Comment


          #5
          LEGEND! That fixed it! Thanks RattleSn4k3

          Comment


            #6
            Good ^^.

            10chars

            Comment

            Working...
            X