- Home /
I keep getting an error and I don't know how to fix it.
I keep getting the error message "Can't add component 'CameraFollow' because it doesn't exist. Check to see if the file name and class name match." I checked and the file name and class name match. I new to Unity and I'm not that good at coding. So I'm following a tutorial and this person had no problems and I did it exactly like they did. Please help.
Problem is with file name and class name. both name should be same. check it once again .
Which tutorial is it?
Like Ekta said, the file name should be "CameraFollow.cs" and the class declaration in this file should look like this:
public class CameraFollow : $$anonymous$$onoBehaviour
if that does not work, delete this file and make a new script with this name. It is important, that you enter the right name to the script, when you create it. If you rename the script later, the class name is not automatically changed.