ForgeZombieBullet.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
	void Update()
	{
		transform.position += (transform.forward * Time.deltaTime) * _bulletSpeed;

		Lifespan -= Time.deltaTime;
		if (Lifespan <= 0) //Make these bullets pooled so it just sets it inactive/active (re-using it)
		{
			if (_hitTarget != null)
				_hitTarget.Damage(this);

			Destroy(gameObject);
		}
	}
ForgeZombieBullet