Projectiles clone infinitely.

ChadBroski01

Terrarian
Basically the title. I have a custom projectile that I want to clone once, and I want the clone to not be able to clone itself. I have tried many options including spawning a different projectile that can't clone or making a variable that has to be false for the projectile to clone and setting that to true in the cloned projectile, but none of that has worked. My code for cloning is below.

Code:
            timer++;
            if (timer == 6)
            {
              Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position, Projectile.velocity.RotatedBy(MathHelper.ToRadians(3)), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner);
            }

The timer makes it so it clones after 0.1 seconds.
 
Back
Top Bottom