skip to Main Content

I just started game development and got into a problem
whenever I load my Visual Studio code into Unity it says
The refrenced script unknown on this behaviour is missing

This is my script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VirtualManMovement : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("Hello, World!") ;
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}

I need a solution for this

2

Answers


  1. This may happen is the file name does not match the class name. Make sure that the file containing this script is also named VirtualManMovement.cs

    Login or Signup to reply.
    1. Make sure in Unity you go to edit -> preferences and see that you have Unity External tools in Your IDE Selected.
    2. Ensure your Code File Name is the same as your Class to prevent confusion.

    I was confused as well when I first started. Hopefully, you find this useful

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search