Unity “The associated script can not be loaded” and “Win32Exception: The system cannot find the file specified”

前端 未结 4 505
-上瘾入骨i
-上瘾入骨i 2021-01-07 08:29

so I\'m new to Unity and I\'ve been trying to test the scene with the script attatched to a character. However, it keeps saying \"The associated script cannot be loaded. Ple

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-07 09:23

    First, it is recommended to use "Add component" to create a script, if you want to attach it to a GameObject, as it automatically imports necessary libraries. Implementing MonoBehaviour is necessary for adding a script to a GameObject.

    Second, FixedUpdate() should not be set to private, it does not need an access modifier, just like Start(), see https://docs.unity3d.com/ScriptReference/MonoBehaviour.FixedUpdate.html.

    Third, the errors in your first screenshot seem to imply that there is a problem with your Unity installation. Try reinstalling it and make sure that the Editor you install matches your operating system (64 or 32 bit?).

    Fourth, the second screenshot is shown when you use any obsolete libraries or classes, which does not seem to be the case in the script you shared.

    Hope that helps.

提交回复
热议问题