How to fix errors in unity: Can't Add Script

preview_player
Показать описание
Unity how to fix errors series.

Can't Add Script is another on our list of most common errors for people starting in C#.
One of the causes of this error is clicking in a different place while creating a new C# script file.

#unity
#error
#tutorials
Рекомендации по теме
Комментарии
Автор

ur a blessing THANK YOU i was stuck for so long :)

OmicronCollective
Автор

thank you so so much bro may god bless you and will get a bugatti and a big house with lots of money

thewolfgaming
Автор

thx bro, u r the best
u helped me so much🤩

DWALKER
Автор

The name matches, but it still doesn't work.

yrpchick_x
Автор

it instantly fixed my movement script in unity thank you much

nicholasmartinez
Автор

Eres el mejor gringo te ganastes mi like

carrotcake
Автор

i have a big problem. every time i try to put a script in an object it gives me a editor error and before unity crash. Btw i have the default name to the script.

alexjordy
Автор

It still doesnt work even though im following a tutorial and rewrote it sewral times :(

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

public class LoadNextLevel : MonoBehaviour
{
[SerializeField]
string strTag;

[SerializeField]
string strSceneName;

private void OnCollisionEnter(Collision collision)
{
if (collision.collider.tag == strTag)

}
}

noagero
Автор

hay i am facing the same error
the script name is also same


using UnityEngine;

public class Target : MonoBehaviour
{


public float health = 50f;


public void TakeDamage (float amount)
{
health -= amount;
if (health <= 0f)
{
Die();
}
}

void Die()
{
Destroy(gameObject);
}

}
this is the code can you help me

monkeykingwk
Автор

Didn't solve my problem & I never changed the name of the script but this always happens.

DWIWindsands
Автор

the name is same but it continue to say the error message.

luveshrughoonauth
welcome to shbcf.ru