Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

share|improve this question

I think you miss to cast your pawn as :

if( myDesiredClass(Other) != none)

Check it and give me feedback if you face any new problem.

share|improve this answer

In my opinion you could either do it by checking the class

Other.class == class'Pawn'

or by casting and checking it whether it's None or not

Pawn(Other) != None

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.