Click to Play!

Thursday, June 26, 2014

Changing Camera's Smooth Follow Target

     For all of Unity's great features, this drawback is a surprising one. I couldn't for the life of me to get SmoothFlow2D to change it's target the way a Component should. This means the camera will have to always be on the player character in that scene. There are ways around this and they can get pretty complicated. For the sake of time I needed a quick solution. As I started writing this post an idea came to me. Have the camera focus on an invisible object that happens to be on the player, then when I want focus to change, move the object somewhere else!

     I wanted the camera to focus on whomever was talking. The results will look the same with this method so problem solved! I really wish Unity's camera worked the way I wanted it to, but I guess this proves that there's always a way if you smash your head into it long enough. It feels like I leveled up my problem solving skills or something because Yotes from a year ago would have either researched how to get SmoothFollow to work for a week or take spend days on making a new camera following script.

No comments:

Post a Comment