I’ve got my camera all set up the way I want it to follow the character around. sometimes the character can go behind walls. I could use a shader to make it glow, or stencil, or something. But I’d like to try and tilt the camera a few degrees to have a better view of the target.
I couldn’t find anything out of the box for this. What I’ve tried is to write a script that would do a line cast between my character and my camera. If there was something there on the obstruction layer then I would try to Lerp the camera’s rotation to have an unobstructed view.
That for the most part worked. I would just find the preferred rotation to have a view of the character and then assign it using the transform.rotation. While this works it’s got some weirdness. Like the camera will bounce around when trying to get a better view. I’m currently under the impression this is so because after rotating the camera the camera’s transform.position changes and then the bouncing is hard to avoid.
I’m trying to keep the camera at a rotation of 70,0,0 but the max would be 85,0,0 if the character was obstructed. Is there something I’m missing that would allow this? I’m currently only using the FollowTarget and a Framing Transposer. Or just some ideas on how to go about achieving the desired effect.
In general you are doing it the right way. Can you describe “bouncing around” in a little more detail? I don’t really understand what you mean. The Framing Transposer algorithm will start with the vcam’s rotation, then move the vcam so that it’s in the desired relationship with the target, while keeping the rotation fixed.
What version of CM are you using?
Can you show an image of the vcam inspector?