Suppose I have some random object in the editor and I want to add scripted behavior to it. How do I do this? I understand I can drag an existing behavior onto it…
- Create the new script (Assets->Create->…)
- Write the script
- Drag it onto object in the scene or hierarchy view. Alternatively, select the object and do Component->Scripts->[your script].
For some reason this eluded me! Thanks