Anyone can parent object to camera so it’ll follow it, but such camera would go through walls and do other “funny” things. How do you go about making smart TPP camera, that follows object at fixed distance, but not go through walls?
This is more discussion/ideas post, so I’m posting it here rather than on Answers.
Sphere cast works great for me. I suggest you to cast one every frame from the head to the last position with a max distance and move the camera to the hit point.
3dbuzz website had a great set of videos where they went through many levels of thought into how to make a really good 3rd person camera.
They were free videos at the time , They might still be free so go have a look. The most difficult concept they tried to solve was how to adjust the camera when anything else is obstructing the view of the player. ( not going the route of alpha of the items in the way )
That been said a general solution is good but it will never work 100% in all situations. From what I’ve studied in existing games most developers will additionally have triggers in the scene telling the camera to take a very specific translation and rotation to get the best results for that area of game play. ( the camera target activates the triggers … not the camera itself )