Is this possible with cinemachine?

Lets say I have 10 game objects of various sizes that each have a virtual camera attached to them (with LookAt set respectively) .

  1. Is there a way to ensure that the object fills the entire view of the camera automatically?
  2. Is it possible to render each virtual camera simultaneously to its own render texture?
  3. What is the best way to make #2 scaleable (50 objects, 100 objects, etc) ?

In other words, does Cinemachine have any advantage over the standard camera/render texture setup?

The reason I’m asking is that I’m trying to make a unique character inventory system that uses actual 3d objects and not icons.

Thanks.

1 Like
  • Yes, if you tell the vcam how big the object is. You’d have to put the object in a CinemachineGroup as the only member, and set its Radius field. Then, use a GroupComposer (or FramingTransposer) to look at the group and frame it the way you want. If you can programmatically get the bounding box of your target objects, then you could write a little script to set the radius in the group accordingly.
  • Yes, by having multiple Unity Cameras, each rendering to a texture. Each of those cameras would need its own Brain, and its own layer.
  • That one’s not so easy. Cinemachine is built on top of the existing cameras. At its core it’s just a bunch of scripts to move those cameras around, and has at the moment no specific involvement with the render pipeline. It just leverages what’s there. And you’ll run out of layers.

Bottom line: since the cameras aren’t doing any fancy footwork (just sitting there framing a static object), Cinemachine doesn’t really buy you anything in this situation.

2 Likes

Thank you so much, you are always very helpful. :slight_smile:

1 Like