Error CS0246

i am making a terraria mod and i am trying to make a sword that shoots projectiles, but this shows up, and i dont know how to fix it. i read the articles for each but did not understand how to fix it.
No description
15 Replies
Concrete Proof
Concrete ProofOP9mo ago
if the code is needed i can send
Pobiega
Pobiega9mo ago
that error just means that it couldn't find the class "TestSwordProjectile" is that a class you made, or one from terraria?
Concrete Proof
Concrete ProofOP9mo ago
i made the projectile, if thats what you mean
Pobiega
Pobiega9mo ago
okay, can you show the code for TestSwordProjectile AND where you are getting the error?
Concrete Proof
Concrete ProofOP9mo ago
No description
Concrete Proof
Concrete ProofOP9mo ago
No description
Pobiega
Pobiega9mo ago
so, your projectile is in the Colesmod.Content.Projectiles namespace and your weapon is in ColesMod.Content.Items.Weapons you need to add a using Colesmod.Content.Projectiles; to the top of your weapon file also, note that you called it ColesMod in one place, and Colesmod in the other that doesnt look very good, so I'd fix that
Concrete Proof
Concrete ProofOP9mo ago
do you mean the weapons folder or the code of the test sword
Pobiega
Pobiega9mo ago
code for the sword at the very top of that file
Concrete Proof
Concrete ProofOP9mo ago
also by top do you mean i should put it as the first line or what
Pobiega
Pobiega9mo ago
see the other using ....; statements? just put it near them
Concrete Proof
Concrete ProofOP9mo ago
ty okay, so the code has no errors but the projectile doesnt exist
Pobiega
Pobiega9mo ago
¯\_(ツ)_/¯ That sounds like something to ask people who know terraria modding
Concrete Proof
Concrete ProofOP9mo ago
fair okay thanks for the help tho
Pobiega
Pobiega9mo ago
this is a general purpose C# server, we can answer questions about the C# part, but not about the specifics regarding terraria np

Did you find this page helpful?