Hi, well this is my first thread,so i hope I'm doing it right...lol... So,I've got a problem with Unity 2.6.1. I can't add scripts to game objects. When I try to, it always says: Can't add script Can't add script behaviour MachineGun. The scripts file name does not match the name of the class defined in the script! What should I do? Thanks to anyone who answers!!!
I think it refers to the name at the top of your script Look at the top of your script, it says public class NewBehaviourScript : MonoBehaviour { If your script is called MachineGun then the above line should be changed to public class MachineGun : MonoBehaviour This is what I do in c# anyway.
In general, you might want to use a more descriptive title for your thread than, "!!!help!!!". Otherwise, people who may be able to help you might just skip over it. Ok, so it looks like you named your script MachineGun. Is this a script that you created? If not, did you rename it from something else? When you look in the script, is the class name MachineGun?
@WinningGuy: Well, I didn't create the script. It was a pre-made script in the fps tutorial from unity3d.com. It isn't on the website anymore but I found it with Google.