Skip to main content
Cleanup
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

UDK: Checking actor type in projectile ProcessTouch

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.SetLocationPawn.SetLocation in the projectile's ProcessTouch. That's a problem because ProcessTouchProcessTouch will hit any actor, not just a pawn. Additionally, any attempts to check the ProcessTouch'sProcessTouch's "Actor Other" throwsthrow errors.

I've tried a bunch of solutions (including making aan event TakeDamageTakeDamage in the PawnPawn 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'sPawn is a bad expression. How else should I check actor type here?

UDK: Checking actor type in projectile ProcessTouch

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?

Checking actor type in projectile ProcessTouch

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" throw errors.

I've tried a bunch of solutions (including making an 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 is a bad expression. How else should I check actor type here?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user