More than one CActorUnit persisting in the same unit scope' when making a new unit

So I made a unit, with a ranged weapon.
this error came up (meaning my unit had no ranged weapon)