I need help with error cs0117

I’m trying to make a mod for a game but i keep getting this error

here’s my code

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace What.Projectiles
{
public class projectile : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault(“bullet”);
}

	public override void SetDefaults()
	{
		
    projectile.Bullet = true;  error is here
	projectile.width = 25;
	projectile.height = 100;
	projectile.aiStyle = 1;
	projectile.friendly = true;
	projectile.ranged = true;
	aiType = ProjectileID.Bullet;

	}

	// Additional hooks/methods here.
}

}

the line is 16 ch 15 and the error is projectile does not contain definition for Bullet (im also having the error for the name projectile does not exist in this current context)

I have the same error too. Did you manage to fix it

In your code, there is no variable or property for projectile. Is it meant to be modifying the current class (or rather instance of)? In which case you’d want this.Xyz, although you don’t have to explicitly state this, so Xyz would also be valid assuming a property or field called Xyz exists and can be accessed on the class.

The issue with Bullet is that unless it exists on ModProjectile and is accessable to this class nothing call Bullet exists, so it has no idea what to set. You’d need to create a property/field on the class first and then set it.