- Home /
one or several scripts - what's better?
Is it better when I create a script for each object or is it also ok when I have one script which is assigned to one object but moves/rotates all objects in my scene. Are there any advantages or disadvantages?
It really depends. What kind of movement are you after? If everything in your scene moves/rotates in a simple, regular fashion, then using just one script to copy the same actions to everything is fine. However, if your objects all have different behaviours, then you should write one script per behaviour ins$$anonymous$$d of having them all driven by the same script.
Answer by Oninji · Jan 15, 2012 at 03:36 AM
A single script that is reused will always be preferable. It greatly increases your workflow.
Your answer
Follow this Question
Related Questions
What is Mono? Is it a compiler? A language? Or what? 3 Answers
What is Vector3, Vector4, etc.? 2 Answers
Does Unity support multiple Inheritance? 3 Answers