Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Can't add script

Discussion in 'Getting Started' started by lyminhquang98, Jun 13, 2022.

  1. lyminhquang98

    lyminhquang98

    Joined:
    Jun 13, 2022
    Posts:
    1
    I can't add script to my game object
    But the name of the script is match with the public class
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Welcome to the forums!

    Does your script have any errors in it? Check the Console window for any messages pointing to specific lines in your script. If it won't compile, you can't add it to your objects (nor can you even run your game).