1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Destroy() Pawn - delay on client?

Discussion in 'Programming' started by Shadow_knight, Mar 4, 2010.

  1. Shadow_knight

    Shadow_knight Carpe diem!

    Joined:
    Jan 29, 2008
    Messages:
    51
    Likes Received:
    0
    Hi,

    I stumbled upon a following issue:
    I have my custom Pawn in the level and at some point I respawn the Pawn on a different location.

    The thing is that although the Pawn on the original location is destroyed, you can still see him there (it seems like the Pawn's mesh was not destroyed, or it was not replicated correctly on client). After some time the old Pawn dissapears (I noticed, when I walk behined a corner and wait there for few secs and return back, the old Pawn mesh dissapears.)

    Currently I don't know why this is happening. Any ideas?

    How I am destroying the Pawn:

    Code:
    simulated function RemoteDestroyPawn() {
    
    	if ( Pawn != None )
    	{
    
    		Pawn.RemoteRole = ROLE_SimulatedProxy;
    
    		Pawn.Died(self, class'DamageType', Pawn.Location);
    		Pawn.Destroy();
    	}
    
    }
    
    Code of my pawn:

    Code:
    class PogamutMale extends GBPawn
    	config(GBEmohawk);
    
    simulated event Destroyed() {
    
    	//destroying shadow
    	if (Shadow != none)
    		Shadow.Destroy();
    
    	super.Destroyed();
    }
    
    simulated event PostBeginPlay()
    {
    	Super.PostBeginPlay();
    
    	LinkMesh(Mesh(DynamicLoadObject("_PGA-EmoboySized.emoboy_mesh", class'Mesh')),false);
    
    	Skins[0]=Texture(DynamicLoadObject("_PGTX-Emoboy.emoboy_skin", class'Texture'));
    	Skins[1]=Texture(DynamicLoadObject("_PGTX-Emoboy.emoboy_clothes_01", class'Texture'));
    }
    
    defaultproperties
    {
    	Mesh=Mesh'_PGA-EmoboySized.emoboy_mesh'
    	IdleAnim="stand_normal"
    	MovementAnims[0]="run_normal"
    	MovementAnims[1]="run_normal"
    	MovementAnims[2]="run_normal"
    	MovementAnims[3]="run_normal"
    	TurnLeftAnim="walk_loop"
    	TurnRightAnim="walk_loop"
    	bPhysicsAnimUpdate=true
    	bCanCrouch=false
    	GroundSpeed=440
    	Skins(0)=Texture'_PGTX-Emoboy.emoboy_skin'
    	Skins(1)=Texture'_PGTX-Emoboy.emoboy_clothes_01'
    	bActorShadows=true
    	BaseEyeHeight=128
    }
    
     

Share This Page