Double-Object Spawned at death of another

  • 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.

SamMaster

Master of the Super Weapons
OK, so my Ice chunk, I found it best to summon it via another projectile. However, whenever, that projectile dies, it spawns 2 of them. Here is the code snipets:

The Chuck Caller:
Code:
function MakeIceChunk()
{
    local Projectile p;
    MomentumTransfer = 0;
    Damage = 0;
    if (bSpawnedIce == false)
        p = Spawn(class 'IceChunk', owner,, location, rotation);
    bSpawnedIce = true;
}
The place where it is called:
Code:
simulated function Destroyed()
{
    if (bSpawnedIce == false)
       MakeIceChunk();

    if (ShockBallEffect != None)
    {
		if ( bNoFX )
			ShockBallEffect.Destroy();
		else
			ShockBallEffect.Kill();
	}

	Super.Destroyed();
}

Any help? BTW I used the base of the shock projectile for it.
 

Postal

I apear to have lost my pin.
Nov 14, 1999
1,388
0
0
WoD.BeyondUnreal.com
No idea, but just in case try putting a { and } in

Code:
if (bSpawnedIce == false)
{
p = Spawn(class 'IceChunk', owner,, location, rotation);
bSpawnedIce = true;
}
 

Smoke39

whatever
Jun 2, 2001
1,793
0
0
Since when does one check the status of boolean variables with ==? Instead of "if ( bSpawnedIce == false )" see if "if ( !bSpawnedIce )" changes anything.