problem: Can't add script bacause of class cannot be found
Name of Script; NewName
using UnityEngine;
public class NewName : MonoBehaviour { Animator animator;
// Start is called before the first frame update
private void Start()
{
animator = GetComponent<Animator>();
}
// Update is called once per frame
private void FixedUpdate()
{
if (Input.GetKeyDown(KeyCode.Q)) { animator.SetTrigger("Attack1");
}
if (Input.GetKeyDown(KeyCode.W)) { animator.SetTrigger("attack"); }
if (Input.GetKeyDown(KeyCode.E)) { animator.SetBool("walk", true);
}
if (Input.GetKeyUp(KeyCode.E)) { animator.SetBool("walk", false);
}
}
}
that is not adding to the game object
how can i solve it?
Answer by xxmariofer · Jul 26, 2019 at 12:27 PM
if you are sure the name of the script is the exact same as the name of the class then is because the script wasnt compiled, edit any line and save and wait for unity to re-compile
Your answer
![](https://koobas.hobune.stream/wayback/20220612205513im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Please Help Me: Assets/Scripts/PlayerControaller.cs(34,33): error CS8025: Parsing error 1 Answer
cannot convert type HealthandInventory to int 0 Answers
How to setactive Car Script on writing script on Java on Android platform 0 Answers
Public Variables Not Displaying In The Inspector 1 Answer
How do I fix "universul?" script problem 0 Answers