Closed gabrielucido closed 1 year ago
The script-to-script systems integrations already are using Scriptable Objects and Event systems like the ones shown in the video: Connecting scripts on the same object in Unity
The main concern for now is to address the architecture that will be used to make inter Objects connections without breaking the modularity and reusability principles.
An option is to deep-dive into Singletons and check if it's a good fit for this project Scriptable Objects work well with inner components, but will it work across different objects?
Done 💪
Now when the player dies the the camera is destroyed alongside the player since it is a child of the player in the player prefab.
My goal is to solve this issue by separating the player from the camera and making a modular asset in the camera that if enabled follows the player but if removed or disabled does not break any of the character or the camera.
Also if we remove the player the camera still should be able to work properly as well as other possible features unrelated to the character's movement and actions. For example, if we had a "pause game feature" when removing the player from the scene the main camera and pause in the UI system should still be working.
The main challenge here is to address the architecture to do it and not how to do it since to make a simple follow-player script we wouldn't need more than a few minutes...