- Home /
can't add script behaviour assemblyinfo. the script needs to derive from monobehaviour
First, excuse my inglish, im from Argentina, my problem is that when I want to add a script to an object I get this error:"can't add script behaviour assemblyinfo. the script needs to derive from monobehaviour", the code is:
"using System.Collections; using System.Collections.Generic; using UnityEngine;
public class script2 : MonoBehaviour {
public HorizontalMove; public VerticalMove; public CharacterController Player;
void Start()
{
Player = GetComponent<CharacterController>();
}
void Update()
{
}
}
"
Answer by xxmariofer · Sep 19, 2019 at 07:55 AM
that code would not even compile, fix the errors like "public HorizontalMove; public VerticalMove;" i imagine you are missing the types or the name of the variables if horizontalmove is the class name
Tienes que corregir los errores antes de intentar añadir el script, HorizntalMove y VerticalMove les falta el tipo o el nombre de la variable algo asi
public HorizontalMove horizontalMove;
or
public int HorizontalMove;
dependiendo si horizontalmove es la clase o el nombre de la variable