Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

A question about Some Scripting

I'm doing the tower defense tutorial, I've created a laser turret and a variant of that turret,

the laser turret damages and slows enemies by a small amount

the variant does a lot less damage but greatly slows the enemy, but when both beams hit the enemy whichever beam hit the enemy more recently it uses its variable amount instead of the higher amount. Im looking for a solution that could have my game have the variant laser trump the defaults slow amount whenever they both interact with the same target.

Any solutions to this? here is the current code referring to the slow amount

public float slowAmount = .5f;


 void Laser()

  {

    targetEnemy.TakeDamage(damageOverTime * Time.deltaTime);

    targetEnemy.Slow(slowAmount);

Sign In or Register to comment.