Hard references can be okay in certain situations, but it’s always best to use soft references whenever possible to maintain loose coupling between objects. In your specific case, if the actor in question will always belong to the player controller and be exclusively used by it, and will always exist with the player controller, then using a hard reference is acceptable. However, it’s always good to be mindful of the potential drawbacks of using hard references, such as increased memory usage and potential errors if the referenced object is destroyed or changes unexpectedly. If you’re unsure about the design, consider discussing it with other team members or seeking advice from experienced developers.
2 Likes