Unable to attach script

Asked 2 years ago, Updated 2 years ago, 283 views

I get this error when I try to attach a script to a game object.

Can`t add script

Can`t add script behaviour Assmblyinfo.cs.The script
needs to derive from MonoBehavior!

Windows 7 Unity 2018.4.24 f1

c#

2022-09-30 21:50

1 Answers

You can attach to Unity objects and Prefab. This class inherits (an ancestor) ScriptableObject or MonoBehavior.

The Unity engine is designed to support the
With these as a landmark, functions called at specific times such as Awake, Start, Update, and FixedUpdate are duck-type-aware and called.

Un
to start writing scripts in Unity It's the first thing I learn, so I think I explain it carefully in a beginner's book.
I recommend starting with Unity textbooks or Unity around C#.


2022-09-30 21:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.