Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

So, to be brief, I'm trying to teleport a pawn when it's struck by a projectile (or damaged by any weapon in my game.)

Right now, I'm trying to just call Pawn.SetLocation in the projectile's ProcessTouch. That's a problem because ProcessTouch will hit any actor, not just a pawn. Additionally, any attempts to check the ProcessTouch's "Actor Other" throws errors.

I've tried a bunch of solutions (including making a event TakeDamage in the Pawn controller class,) but to no avail.

    simulated function ProcessTouch(Actor Other, Vector HitLocation, Vector HitNormal)
    {
         if (Other != Instigator)
         {
              //This is where the Other.TakeDamage goes if we are using a traditional gun.
              if (Other == Pawn);
              {
                   Other.SetLocation(0,0,0);
              }
         }
    Destroy;
    }

This code complains that Pawn's a bad expression. How else should I check actor type here?

share|improve this question
    
Have you tried casting ? e.g. if( myDesiredClass(Other) != none) . –  EmAdpres May 21 '13 at 18:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.