Scripting is a necessary evil when you need to go beyond the included assets installed with Unity. It might be beneficial to look around the Asset Store to add other tools and scripts to your arsenal, but a decent understanding of scripts is a valuable competence to gain in the long run.
Always strive for short, simple, understandable, and reusable scripts. If you need two unrelated behaviors, they might be better off being split into two scripts. To make scripts reusable for different contexts, give them a rather generic name. RotateObject
is more versatile than RotateDoor
. If variables need to be adjusted, provide them as public variables, so they become parameters of the scripts. Reusable scripts never need to be edited during usage, but mainly tweaked by their parameters.
Add easing and tweening to improve smoothness and to obtain a visual, modern animation style. If you are pressed in time, you might cut some corners here, but they do provide an overall professional feel to your...