- Home /
Question by
unity_Rq2FjR1nmxkZQg · Apr 06, 2018 at 09:41 PM ·
1st person
I wrote a script in visual studio and when i am trying to put it in the player a messge shows up that says that it needs to be monobehaviour
I am trying to make my player move and i am constantly getting an error that says it hes to be monobehaviour. I will post a question with more detail because I am not near my computer and I hope someone will understand whats my problem and anwser it.
Comment
Answer by Chik3r · Apr 06, 2018 at 11:19 PM
To add a script to a component it IS required that the script inherits from MonoBehaviour, instead you could add a var with the type as the class you want to add to a script.
Your answer
![](https://koobas.hobune.stream/wayback/20220612160227im_/https://answers.unity.com/themes/thub/images/avi.jpg)