- Home /
Inspector vs Script: Component best practice?
Hey! im new to Unity but know a little C#.
i have a question on "best practice" when creating components:
you can add components (audiosources, rigidbodies, colliders etc) to your stuff via the inspector but i added all that in script because i like being able to look at my code and see exactly whats goin on.
however i have a nagging feeling that unity really wants you to do that stuff in the inspector...
what is considered best practice and are there performance/optimization differences to be aware of?
thanks!
theres no real difference, unless you are adding some resource heavy scripts, which may cause stutter at runtime.
Answer by Itaros · Oct 24, 2014 at 07:12 AM
Most custom level serializers do this. You are on a right track. Use the way which is more convenient to you :)
Unity is built to let coders pretend there is no scene, and artists pretend there is no code.