I am currently in the process of making a player controller script. Movement is done and I’m now facing the problem of camera movement.
Previously, I made the camera follow the player by making it a child of a child in the player - the camera pivot and the Camera itself. This let me simply offset the camera without changing the pivot and I didn’t have to worry about tracking the player.
But now I’m rewriting the player controller script from scratch (as the old version was poorly written) and seeing some of the disadvantages of that system (more object references, harder-to-implement camera smoothing, etc.), I wondered if making the camera actually track the player would be better.
Though, I don’t know the performance impact of using Transform.LookAt(player) and Transform.TransformPosition(offset) every LateUpdate(). Does anyone have more experience with this? I can’t really use the profiler, nor can I measure performance impact in any other way that well, so help would be appreciated.
Thanks!