Skill.Skill()': member names cannot be the same as their enclosing type

error :
error CS0542: `Skill.Skill()': member names cannot be the same as their enclosing type

script :

public class Skill : ModifiedStat {
	 private bool _known; 
	
	public void Skill() {
		_known = false;
		ExpToLevel = 25;
		LevelModifier = 1.1f;
	}
	
	public bool Known {
		get{ return _known;}
		set { _known = value;}
	}
}

public enum SkillName{
	Melee_Offence,
	Melee_Defence,
	Ranged_Offence,
	Ranged_Defence,
	Magic_Offence,
	Magic_Defence
}

You should select your code and hit the 010101 button above to format it

1 Answer

1

Well in this case, take the ‘void’ out of public void Skill()

What Dave said.

Particles don't really work like that. You can't detect collisions etc with a unity particle, hence creating another object to act as the actual projectile. You can control the way the particles are drawn based on the movement of the actual projectile to make it appear that the particles are the projectile.